Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
alexanderatallah authored Mar 8, 2023
1 parent d4470bb commit aa2a2bf
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,12 @@ const value = { a: 'result' }

await db.get(key) // undefined

await db.set(key, value)
await db.save(key, value)

await db.get(key) // value

// Type safety!
await db.set(key, { c: 'result2' }) // Type error on value
await db.save(key, { c: 'poorly formed object' }) // Type error on value

// Browsing results
let data = await db.filter()
Expand All @@ -92,9 +92,9 @@ assertEqual(await db.count(), 1)
// Hierarchical indexes, using a customizable tag separator (default: '/')
await Promise.all([
// Redis auto-pipelines these calls into one fast request!
db.set(uuid(), { a: 'hi' }, { tags: ['user1/project1'] }),
db.set(uuid(), { a: 'there' }, { tags: ['user1/project2'] }),
db.set(uuid(), { a: 'bye' }, { tags: ['user2/project1'] })
db.save(uuid(), { a: 'hi' }, { tags: ['user1/project1'] }),
db.save(uuid(), { a: 'there' }, { tags: ['user1/project2'] }),
db.save(uuid(), { a: 'bye' }, { tags: ['user2/project1'] })
])

data = await db.filter()
Expand Down

0 comments on commit aa2a2bf

Please sign in to comment.