-
Notifications
You must be signed in to change notification settings - Fork 0
api API
The function
hello
sends a message to the background script, which in turn sends a message to the content script, which in turn sends a message to the database script, which in turn sends a message to the database, which in turn sends a message to the database script, which in turn sends a message to the content script, which in turn sends a message to the background script, which in turn sends a message to the functionhello
, which in turn returns the message
Returns any A promise.
get
is a function that takes two parameters, tableName
and documentId
, and returns a promise that
resolves to the document with the given documentId
from the table with the given tableName
-
tableName
string The name of the table you want to get the document from. -
documentId
string The document id of the document you want to get.
Returns Promise<Document> A promise.
This function creates a table with the name
tableName
in the database
-
tableName
string The name of the table to create.
Returns Promise A promise.
It creates a database with the name dataBaseName
and returns a promise
-
databaseName
string The name of the database you want to create.
Returns Promise A promise.
It deletes the database.
-
databaseName
string The name of the database you want to delete.
Returns Promise A promise.
The
put
document to cocoDN script, which in turn sends a message to theput
function, which in turn returns the message
-
tableName
string The name of the table to put the document into. -
document
Object The document to be inserted into the database.
Returns Promise A promise.
It creates an index on a table.
-
tableName
string The name of the table to create the index on. -
jsonField
string The name of the field in the JSON object that you want to index. -
dataType
string The data type of the index. This can be one of the following: -
isUnique
boolean true/false -
isNotNull
boolean If true, the index will be created with the NOT NULL constraint.
Returns Promise A promise.
It returns list of documents matching the queryObject
-
tableName
string The name of the table you want to query. -
queryObject
Object This is the object that you want to query the table with. -
options
Object Optional parameter to add pagination. (optional, default{}
)-
options.pageOffset
number specify which row to start retrieving documents from. Eg: to get 10 documents from the 100'th document, you should specifypageOffset = 100
andpageLimit = 10
-
options.pageLimit
number specify number of documents to retrieve. Eg: to get 10 documents from the 100'th document, you should specifypageOffset = 100
andpageLimit = 10
-
Returns Promise
It returns list of documents matching the queryObject after scanning the COCO DB
-
tableName
string The name of the table you want to query. -
queryObject
Object This is the object that you want to query the table with. (optional, default{}
) -
options
Object Optional parameter to add pagination. (optional, default{}
)-
options.pageOffset
number specify which row to start retrieving documents from. Eg: to get 10 documents from the 100'th document, you should specifypageOffset = 100
andpageLimit = 10
-
options.pageLimit
number specify number of documents to retrieve. Eg: to get 10 documents from the 100'th document, you should specifypageOffset = 100
andpageLimit = 10
-
Returns Promise
This function deletes a document from a table
-
tableName
string The name of the table you want to delete the document from. -
documentId
string The id of the document to delete. -
condition
string? Optional coco query condition of the form "$.cost<35" that must be satisfied for delete to happen. See query API for more details on how to write coco query strings.
Returns Promise A promise.
This function deletes a table from the database
-
tableName
string The name of the table to delete.
Returns Promise A promise.
do mathematical addition on given json fields by given values in jsonFieldsIncrements
-
tableName
string The name of the table you want to update. -
documentId
string The document id of the document you want to update. -
jsonFieldsIncrements
Object A JSON object with the fields to increment and the amount to increment them by.
Returns Promise A promise.
Update a document in a table
-
tableName
string The name of the table to update the document in. -
documentId
string The id of the document to update. -
document
Object The document to be updated. -
condition
string? Optional coco query condition of the form "$.cost<35" that must be satisfied for update to happen. See query API for more details on how to write coco query strings.
Returns Promise A promise.
It queries the database for a given table name and query string.
-
tableName
string The name of the table you want to query. -
queryString
string The query string to be executed. -
useIndexForFields
Array<string> This is an array of fields that you want to use the index for. (optional, defaultnull
) -
options
Object Optional parameter to add pagination. (optional, default{}
)-
options.pageOffset
number specify which row to start retrieving documents from. Eg: to get 10 documents from the 100'th document, you should specifypageOffset = 100
andpageLimit = 10
-
options.pageLimit
number specify number of documents to retrieve. Eg: to get 10 documents from the 100'th document, you should specifypageOffset = 100
andpageLimit = 10
-
Returns Promise A promise