js-data-mongodb
MongoDB adapter for js-data.
API Documentation
Quick Start
npm install --save js-data js-data-mongodb
.
var JSData = require('js-data');
var DSMongoDBAdapter = require('js-data-mongodb');
var store = new JSData.DS();
var adapter = new DSMongoDBAdapter('mongodb://localhost:27017');
// "store" will now use the MongoDB adapter for all async operations
store.registerAdapter('mongodb', adapter, { default: true });
var User = store.defineResource({
// Why couldn't Mongo just use "id"?
idAttribute: '_id',
// map this resource to a collection, default is Resource#name
table: 'users'
});
Changelog
See CHANGELOG.md.
Community
Support
Support questions are handled via StackOverflow, Slack, and the Mailing List. Ask your questions there.
When submitting bug reports on GitHub, please include as much detail as possible to make debugging quick and easy.
Contributing
See CONTRIBUTING.md.
License
The MIT License (MIT)
See LICENSE.