![require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages](https://cdn.sanity.io/images/cgdhsj6q/production/be8ab80c8efa5907bc341c6fefe9aa20d239d890-1600x1097.png?w=400&fit=max&auto=format)
Security News
require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
sails-mongo
Advanced tools
Sails.js/Waterline adapter for MongoDB.
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.
To install this adapter, run:
$ npm install sails-mongo
Then connect the adapter to one or more of your app's datastores.
Visit Models & ORM in the docs for more information about using models, datastores, and adapters in your app/microservice.
This adapter implements the following methods:
Method | Status | Layer |
---|---|---|
N/A | ||
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 |
See Extending Sails > Adapters > Custom Adapters in the Sails documentation, or check out recommended support options.
Please observe the guidelines and conventions laid out in the Sails project contribution guide when opening issues or submitting pull requests.
Thanks so much to Ted Kulp (@tedkulp) and Robin Persson (@prssn) for building the first version of this adapter back in 2013. Since then, it has evolved into a core adapter within the framework.
To report a bug, click here.
This core adapter is available under the MIT license.
As for Waterline and the Sails framework? They're free and open-source under the MIT License.
FAQs
Mongo DB adapter for Sails.js/Waterline.
The npm package sails-mongo receives a total of 2,322 weekly downloads. As such, sails-mongo popularity was classified as popular.
We found that sails-mongo demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 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.
Security News
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.