
Product
Introducing Tier 1 Reachability: Precision CVE Triage for Enterprise Teams
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
dexie-mongoify
Advanced tools
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 = new Dexie('Database');
db.version(1).stores({ people: '++id, firstname, lastname, age' });
db.open();
// 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.collection('people').insert(person).then(function() {
// John is in db now :)
});
Get all objects:
db.collection('people').find({}).toArray().then(function(people) {
// empty query returns all objects
});
Get objects by simple field match:
db.collection('people').find({ age: 30 }).toArray().then(function(people) {
// people 30 years old
});
You can also use some of the MongoDB query operators:
db.collection('people').find({ age: { $gte: 23 } }).toArray().then(function(people) {
// people that are 23 and more years old
});
db.collection('people').update({ lastname: 'Doe' }, { age: 10 }).then(function(updatesCount) {
// all Does are 10 years old now
});
Using update operators:
db.collection('people').findOne({ skills: { $in: ['html', 'javascript'] } }, updates).then(function(person) {
return db.collection('people').update(person, { $push: { skills: 'jquery' } });
}).then(function(updatesCount) {
// person has jquery skills now
});
MIT © Yury Solovyov
FAQs
Dexie.js plugin with MongoDB-like API
We found that dexie-mongoify demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
Research
/Security News
Ongoing npm supply chain attack spreads to DuckDB: multiple packages compromised with the same wallet-drainer malware.
Security News
The MCP Steering Committee has launched the official MCP Registry in preview, a central hub for discovering and publishing MCP servers.