Skip to content

theguest268/sails-mongo

 
 

Repository files navigation

Node.js and MongoDB on Sails.js/Waterline

sails-mongo

Sails.js/Waterline adapter for MongoDB. (See compatibility for more details.)

Provides easy access to MongoDB from Sails.js & Waterline. This module is a Sails/Waterline adapter maintained by the core team. Its goal is to provide robust, easy-to-use access to MongoDB from Sails.js and Waterline.

As an adapter, this module implements a set of declarative interfaces, conventions, and best-practices for integrating with Mongo databases. Strict adherence to an adapter specification enables the (re)use of built-in generic test suites, standardized documentation, reasonable expectations around the API for your users, and overall, a more pleasant development experience for everyone.

Installation

To install this adapter, run:

$ npm install sails-mongo

Then connect the adapter to one or more of your app's datastores.

Usage

Visit Models & ORM in the docs for more information about using models, datastores, and adapters in your app/microservice.

Compatibility

This version of the adapter has been tested with MongoDB versions 3.4 and 3.6.

This adapter implements the following methods:

Method Status Layer
registerDatastore Implemented N/A
teardown Implemented N/A
validateModelDef Implemented Modeled
createRecord Implemented Modeled (DML)
createEachRecord Implemented Modeled (DML)
updateRecords Implemented Modeled (DML)
destroyRecords Implemented Modeled (DML)
findRecords Implemented Modeled (DQL)
join not supported Modeled (DQL)
countRecords Implemented Modeled (DQL)
sumRecords Implemented Modeled (DQL)
avgRecords Implemented Modeled (DQL)
definePhysicalModel Implemented Migratable
dropPhysicalModel Implemented Migratable
setPhysicalSequence not supported Migratable

Questions?

See Extending Sails > Adapters > Custom Adapters in the Sails documentation, or check out recommended support options.

Contributing