create(threadID, collectionName, values) | | Creates a new model instance in the given store. |
delete(threadID, collectionName, IDs) | | Deletes an existing model instance from the given store. |
deleteCollection(threadID, name) | | Deletes an existing collection. |
deleteDB(threadID) | | Deletes an entire DB. |
find(threadID, collectionName, query) | | Queries a collection for entities matching the given query parameters. |
findByID(threadID, collectionName, ID) | | Queries the collection by a known instance ID. |
getCollectionIndexes(threadID, name) | | Returns an existing indexes for a collection. |
getCollectionInfo(threadID, name) | | |
getDBInfo(threadID) | | Returns a DBInfo objection containing metadata required to invite other peers to join a given thread. |
getToken(identity, ctx) | | Obtain a token per user (identity) for interacting with the remote API. |
getTokenChallenge(publicKey, callback, ctx) | | Obtain a token per user (identity) for interacting with the remote API. |
has(threadID, collectionName, IDs) | | Check if a given instance exists in the collection. |
joinFromInfo(info, includeLocal, collections) | | Connect client to an existing database using information in the DBInfo object This should be called before any operation on the store, and is an alternative to open, which re-opens a database already opened by the user. |
listCollections(thread) | | Lists the collections in a thread |
listDBs() | | Lists all known DBs. |
listen(threadID, filters, callback) | | listen opens a long-lived connection with a remote node, running the given callback on each new update to the given instance. The return value is a close function, which cleanly closes the connection with the remote node. |
newCollection(threadID, config) | | newCollection registers a new collection schema under the given name. The schema must be a valid json-schema.org schema, and can be a JSON string or object. |
newCollectionFromObject(threadID, obj, config) | | newCollectionFromObject creates and registers a new collection under the given name. The input object must be serializable to JSON, and contain only json-schema.org types. |
newDB(threadID, name) | | newDB creates a new store on the remote node. |
newDBFromAddr(address, key, collections) | | newDBFromAddr initializes the client with the given store, connecting to the given thread address (database). It should be called before any operation on the store, and is an alternative to start, which creates a local store. newDBFromAddr should also include the read/follow key, which should be a Uint8Array or base32-encoded string. |
open(threadID, name) | | open creates and enters a new store on the remote node. |
readTransaction(threadID, collectionName) | | readTransaction creates a new read-only transaction object. See ReadTransaction for details. |
save(threadID, collectionName, values) | | Saves changes to an existing model instance in the given store. |
updateCollection(threadID, config) | | updateCollection updates an existing collection. Currently, updates can include name and schema. Allow update of indexing information. |
verify(threadID, collectionName, values) | | Verify checks existing instance changes. Each model instance must have a valid existing _id property. |
withKeyInfo(key, host, debug) | static | Create a new gRPC client instance from a supplied key and secret |
withUserAuth(auth, host, debug) | static | Create a new gRPC client instance from a supplied user auth object. Assumes all default gRPC settlings. For customization options, use a context object directly. The callback method will automatically refresh expiring credentials. |
writeTransaction(threadID, collectionName) | | writeTransaction creates a new writeable transaction object. See WriteTransaction for details. |