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.
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;
Get all objects:
Get objects by simple field match:
You can also use some of the MongoDB query operators:
Using update operators:
MIT © Yury Solovyov