We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Data in streamlet can be accessed via the following commands: Retrieving
db.get(n)
let db = new streamlet(path.join(__dirname, 'db.sl')) async () => { await db.init() db.get(0) // {item: 'foo', number: 1} }
Will Get the nth non deleted item in the database
n
db.find(fn)
let db = new streamlet(path.join(__dirname, 'db.sl')) async () => { await db.init() await db.find(i => {return i.name === 'bar'?i:undefined}) // {item: 'bar', number: 2} }
db.find will return all items which can be iterated over in a function
db.find
db.findById(id)
let db = new streamlet(path.join(__dirname, 'db.sl')) async () => { await db.init() await db.findById(`hFkEXrkuRyGQAf8t7vzshw/0000000000`) // {item: 'foo', number: 1} }
This will find an item by its auto assigned _id
_id
db.findIndex(fn)
???
db.findIndexes(fn)