Mongoify
Mongoify is an addon for Dexie.js, IndexedDB wrapper.
Mongoify tries to provide MongoDB-like* query language and API, but uses promises instead of callbacks.
*
MongoDB-like means that Mongoify tries to follow MongoDB where it makes sense, to simplify API and implementation.
You are welcome to send PR that increases MongoDB compatibility.
Examples:
You need to open database first:
var db = 'Database';dbversion1;db;// Thanks to Dexie, there is not need to wait for database to open,// you can start working right away
Then you can start inserting objects:
var person = firstname: 'John' lastname: 'Doe' age: 30 ;db;
Querying database:
Get all objects:
db;
Get objects by simple field match:
db;
You can also use some of the MongoDB query operators:
db;
Updating objects:
db;
Using update operators:
db;
License
MIT © Yury Solovyov