sails-firestore v0.2.3
sails-firestore
Provides easy access to Cloud Firestore from Sails.js & Waterline.
This module is a Sails/Waterline community adapter. Its goal is to provide a set of declarative interfaces, conventions, and best-practices for integrating with the Google Cloud Firestore database/service.
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-firestoreThen connect the adapter to one or more of your app's datastores.
Usage
// config/datastores.js
module.exports.datastores = {
default: {
adapter: 'sails-firestore',
serviceAccount: require('../your-service-key')
}
};Visit Models & ORM in the docs for more information about using models, datastores, and adapters in your app/microservice.
Questions?
See Extending Sails > Adapters > Custom Adapters in the Sails documentation, or check out recommended support options.
Compatibility
This adapter implements the following methods:
| Method | Status | Category |
|---|---|---|
| registerDatastore | Implemented | LIFECYCLE |
| teardown | ??? | LIFECYCLE |
| create | Implemented | DML |
| createEach | Implemented | DML |
| update | Implemented | DML |
| destroy | Implemented | DML |
| find | Implemented | DQL |
| join | ??? | DQL |
| count | Implemented | DQL |
| sum | Implemented | DQL |
| avg | Implemented | DQL |
| define | ?? | DDL |
| drop | Implemented | DDL |
| setSequence | Implemented | DDL |
Query language
| Modifier | Status | Remark |
|---|---|---|
| < | Implemented | |
| <= | Implemented | |
| > | Implemented | |
| >= | Implemented | |
| == | Implemented | |
| != | Implemented | |
| in | Implemented | |
| !in | Implemented | |
| contains | Implemented | client-side |
| startsWith | Implemented | |
| endsWith | Implemented | client-side |
| and | Implemented | |
| or | Implemented |
| Option | Status | Remark |
|---|---|---|
| limit | Implemented | client-side |
| sort | Implemented | client-side |
| skip | Implemented | client-side |
You may see the test result here.
License
This firestore adapter is available under the MIT license.
As for Waterline and the Sails framework? They're free and open-source under the MIT License.
