@rappopo/dab-memory v0.6.11
@rappopo/dab-memory
A Rappopo DAB implementation for in-memory datastore, powered by Lodash and lodash-query.
Installation
Simply invoke this command in your project folder:
$ npm install --save @rappopo/dab-memory
And within your script:
const DabMemory = require('@rappopo/dab-memory')
const dab = new DabMemory()
// prepare collections
dab.createCollection({ name: 'test' })
.then(result => {
return dab.bulkCreate(data, { collection: 'test' })
})
...
// lets dab!
dab.findOne('my-doc', 'test').then(function(doc) { ... })
Options
Currently, no options necessary.
Features
Data is internally saved as collections as follows:
dab.data.<collection-name> = [
{ _id: "key1", name: "name1", ... },
{ _id: "key2", name: "name2", ... }
]
To enforce structured data throughout DAB and use features provided by collections, you need to createCollection ()
with your custom fields as explained here
- find
- findOne
- create
- update
- remove
- bulkCreate
- bulkUpdate
- bulkRemove
- copyFrom
- copyTo
- createCollection
- renameCollection
- removeCollection
Donation
License
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago