Package Exports
- loopback-connector-couchbase3
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (loopback-connector-couchbase3) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
loopback-connector-couchbase3
This is a Couchbase connector node module for Loopback with loopback-datasource-juggler. Without N1QL for now.
CRUD methods
- Insert
For document insert
only, and will not update a existed one. If there is a document with same ID, a exception will be thrown. If insert successfully, a instance will be returned.
Note: There should be a custom id in data model, like:
var Person = db.createModel('person', {id: {type: String, id: true}, name: String, age: Number});
var Student = db.createModel('student', {No: {type: String, id: true}, name: String, age: Number, emails:[String]});
- Find
Find document by a given document ID. If there is no document matched, a exception will be thrown.
- Update
Update a existed document by giving a document ID, or create a new one if there is no such a document, like Insert
.
- Remove
Remove document by a given document ID. If there is no document matched, a exception will be thrown.
Test
Run your CouchBase Server at 127.0.0.1 first.
$ mocha test
Run benchmark test:
$ make benchmarks
the results is ./benchmarks/results.md
For detail information:
$ DEBUG=loopback:connector:couchbase3 mocha test
Git Summary
project : loopback-connector-couchbase3
repo age : 8 weeks
active : 16 days
commits : 37
files : 32
authors :
20 CCharlieLi 54.1%
10 Makara Wang 27.0%
4 chopperlee 10.8%
3 Leo Zhou 8.1%