Registry / database / jugglingdb-mongodb

jugglingdb-mongodb

JSON →
library0.2.0jsnpmunverified

MongoDB adapter for the JugglingDB ORM. This package requires jugglingdb@0.2.x and provides a MongoDB backend for JugglingDB models. Version 0.2.0 is the latest release with no recent updates. The adapter supports MongoDB write concern and journaling options. It is limited to usage with the older JugglingDB 0.2.x series and has no TypeScript support. The project appears to be in maintenance mode, as the last update was years ago.

npm install jugglingdb-mongodb
INSTALL
IMPORT
SIG · JUGGLINGDB-MONGODB
J
jugglingdb-mongodb
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.

Schema
var Schema = require('jugglingdb').Schema; var schema = new Schema('mongodb');
var Schema = require('jugglingdb-mongodb').Schema;
Schema is from jugglingdb, not from this adapter. The adapter is just a plugin.
jugglingdb-mongodb (autoloaded)
require('jugglingdb-mongodb'); // no explicit export needed, autoloads when Schema is used
var mongoAdapter = require('jugglingdb-mongodb'); // not meant to be used directly
The adapter is automatically registered by jugglingdb when the package is required. No direct exports are used.

Connects JugglingDB to MongoDB, defines a Post model, and creates a record after auto-migration.

var Schema = require('jugglingdb').Schema; var schema = new Schema('mongodb', { url: process.env.MONGODB_URL || 'mongodb://localhost/myapp', w: 1, j: 1 }); var Post = schema.define('Post', { title: { type: String, length: 255 }, content: { type: String } }); schema.automigrate(function() { Post.create({ title: 'Hello', content: 'World' }, function(err, post) { console.log('Post created:', post.id); }); });
Debug
Known issues
breakingRequires jugglingdb@0.2.x – incompatible with newer versions of jugglingdb
fix
Use jugglingdb-mongodb@0.2.x only with jugglingdb@0.2.x. For newer jugglingdb, consider loopback-datasource-juggler or other ORMs.
affects: >=0.2.0
deprecatedPackage is no longer actively maintained; last release in 2014
fix
Migrate to a maintained alternative like mongoose or loopback-datasource-juggler with MongoDB connector.
affects: *
gotchaNo TypeScript definitions – use with JS only or create custom .d.ts
fix
Add your own type definitions or use @types/jugglingdb if available.
affects: *
gotchaAdapter does not support modern MongoDB features like transactions or aggregation pipelines
fix
Use mongoose or native MongoDB driver for advanced features.
affects: *
breakingRequires MongoDB server running locally for tests with default credentials (user: travis, password: test, db: myapp)
fix
Modify test configuration or set up local MongoDB accordingly.
affects: *
Errors
Common errors & fixes
Cannot find module 'jugglingdb'
jugglingdb is not installed as a dependency
fix
Run: npm install jugglingdb@0.2.x jugglingdb-mongodb
Error: Schema is not defined
Trying to use jugglingdb-mongodb exports directly
fix
Use var Schema = require('jugglingdb').Schema; not require('jugglingdb-mongodb').
Error: unknown adapter 'mongodb'
jugglingdb-mongodb is not installed or not required before creating schema
fix
Add require('jugglingdb-mongodb'); at the top of your file.
MongoError: failed to connect to server [localhost:27017] on first connect
MongoDB server is not running or URL is wrong
fix
Start MongoDB or provide correct URL via url option in schema.
Upgrade
Version history
0.2.0latest on npm
Audit
Dependencies
jugglingdbrequiredPeer dependency required for schema and model functionality
mongodboptionalMongoDB native driver for database operations
Agent activity
4 hits · last 30 days
node
4
Resources
jugglingdb-mongodb — npm install jugglingdb-mongodb · libregistry