Node Sequoiadb
Node.js Driver for SequoiaDB
Installation
$ npm install sequoiadb --save
API
Client
Create a client to sequoiadb server:
var Client = Client;var client = 11810 "ip" user: "" pass: "";
Disconnect with sequoiadb server:
client;
Wait for client ready:
client;
All operation must be after db ready.
User
Create a user:
client;
Remove a user:
client;
CollectionSpace
Create CollectionSpace in sequoiadb:
client;
Get CollectionSpace in sequoiadb by name:
client;
Check given space name whether exist:
client.isCollectionSpaceExist("space_name", function (err, exist) {
// TODO
});
Drop CollectionSpace:
client;
Get all CollectionSpaces:
client;
Cursor
Get current item:
cursorcurrent { // TODO};
Get next item:
cursornext { // TODO};
Close cursor:
cursor;
Collection
Create a Collection in CollectionSpace:
space;
Get a Collection from CollectionSpace by given name:
space;
Check a Collection whether exist:
space;
Drop a Collection from a CollectionSpace:
space;
Document
Insert a document into Collection:
collection;
Upsert a document into Collection:
collection;
Bulk insert documents into Collection:
var insertors = name: "hi" name: "jack";collection;
Query all document of Collection:
collection;
Delete document:
collection;
Delete all documents:
collection;
Aggregate:
var insertors = $match:status:"A" $group: _id: "$cust_id" total: $sum: "$amount";collection;
Index
Create Index for collection:
var key = "Last Name": 1 "First Name": 1;collection;
Get index with given name:
collection;
Get all indexes:
collection;
Or:
collection;
Drop index:
collection;
Lob
Get Lobs:
collection;
Create Lob:
var lob = collection;
Open Lob:
var lob = collection;
Write data into lob:
lob;
Read data from lob:
lob;
Seek the position:
var Lob = Lob;lob; // 0 + poslob; // current + poslob; // total - pos
Close lob:
lob;