Registry / database / zealot

zealot

JSON →
library0.2.0jsnpmunverified

Zealot is a futurist MongoDB library for Node.js 7+ that provides a proxy-based API allowing CRUD operations via property assignment and deletion syntax. It wraps the MongoDB driver's native API (db.collection, findOne, update, deleteOne, drop) with async/await support. As of v0.2.0, it is in early development with limited features and no connection pooling or advanced query capabilities. It offers a unique syntactic style but sacrifices clarity and is not recommended for production use. Release cadence is unknown; last published 2016.

npm install zealot
INSTALL
IMPORT
SIG · ZEALOT
Z
zealot
databasejavascriptv0.2.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
import zealot from 'zealot'
const zealot = require('zealot').default
ESM default import works directly as the package exports a single function/object.
open
zealot.open(uri)
const { open } = require('zealot')
open is a method on the default export, not a named export.
collection access
zealot.collectionName.find()
zealot.getCollection('collectionName').find()
Collections are accessed via property names on the zealot object (Proxy). No getCollection method exists.

Demonstrates open connection, insert via assignment, findOne, update via property set, delete document, and drop collection.

const zealot = require('zealot') async function main() { await zealot.open('mongodb://localhost:27017/test') // Insert a document using assignment await (zealot.users['john_doe'] = { name: 'John Doe', email: 'john@example.com' }) // Find one document const user = await zealot.users.findOne({ name: 'John Doe' }) console.log('Found user:', user) // Update via assignment await (zealot.users[user._id].email = 'john.doe@example.com') // Delete a document await (delete zealot.users[user._id]) // Drop collection await (delete zealot.users) } main().catch(console.error)
Debug
Known issues
gotchaProperty assignment and deletion are async and must be awaited, but they look like synchronous operations.
fix
Always use await when assigning or deleting to trigger the database operation.
affects: >=0.1.0
gotchaCollection names are accessed as properties of the zealot object. Using a variable as a collection name is not straightforward.
fix
Use zealot[collectionName] where collectionName is a string variable.
affects: >=0.1.0
breakingOnly works with Node.js 7+ due to async/await and Proxy support. Older versions will throw errors.
fix
Upgrade to Node.js 7+ or use a transpiler like Babel.
affects: >=0.1.0
deprecatedThe library is early-stage and not actively maintained. The last release was in 2016.
fix
Consider using the official MongoDB driver (mongodb) or Mongoose for production.
affects: >=0.1.0
Errors
Common errors & fixes
ReferenceError: zealot is not defined
Missing require or import of the package.
fix
Add 'const zealot = require('zealot')' or 'import zealot from 'zealot'' at the top.
TypeError: zealot.open is not a function
Forgot to require the package, so zealot is undefined or a different object.
fix
Ensure require('zealot') returns the correct object.
SyntaxError: await is only valid in async function
Using await outside an async function.
fix
Wrap code in an async function.
Upgrade
Version history
0.2.0latest on npm
Audit
Dependencies
mongodbrequiredCore MongoDB driver required for all database operations
Agent activity
30 hits · last 30 days
node
26
OpenAI (training)
1
Resources
packagezealot
zealot — npm install zealot · libregistry