Skip to main content

A8Data


getApp

Returns all the "collections" of the provided "appID" and their respective executable methods.

When to use?

Best used when you need to retrieve a cross-app collections list.

a8data

Then, from the collections list returned through the "getApp" function, you can select the "collection" that you would want to execute and call forth the needed "executable method".

Note: The available executable methods are: Find, Update, Insert, and Delete.

Method:
getApp(appId:string)
Usage:
/* The "variable collections" returns the collections-list for the appID: "13815a6c-f003-427e-b17e-
f45fcb59d664". Here, you can use the "collections" variable to access the "find (or insert, update, and
delete)" executable method for the "Applicant_Data" collections. This will then return the result to the
"variable document".*/

var collections = await a8data.getApp("13815a6c-f003-427e-b17e-f45fcb59d664");
var document = collections.Applicant_Data.find({"id":0});

Methods

tip

When working on your current app's collection list, you can directly use the "executable methods" without requiring the "getApp" function.

find

Returns a list of all the documents available for a particular collection of apps.

Optional: The "query object" field is optional. Also, you can filter individual documents within the collection.

Method:
find(query?:object)
Usage:
// Displays all documents of the "Applicant_Data" collection.

await a8data.Applicant_Data.find()

// Displays only documents with the ID (0) from this "Applicant_Data" collection.

await a8data.Applicant_Data.find({ "id": 0 })



insert

Helps "insert" documents into a particular "collection" of the app.

Method:
insert(document:object)
Usage:
/* Inserts a document (with the values: "id: 3", "age: 5", and "name: kowsiya") to the "Applicant_Data"
collection.*/

await a8data.Applicant_Data.insert
({
"id": 3,
"age": 5,
"name": "kowsiya"
})

update

Helps "update" the documents in a particular collection, provided an updated document and its documentID are available.

Method:
update(document: Object, documentId: number)
Usage:
/* Updates the documentID (16298008) in the "Applicant_Data" collection with the given values ("id: 0", "age:
25", and "name: deepika").*/

await a8data.Applicant_Data.update
({
"id": 0,
"age": 25,
"name": "deepika"
},
16298008
)

delete

Helps "delete" a particular document in the collection when provided with the "documentID".

Method:
delete(documentId: number)
Usage:
// Deletes the document with the "documentID: 16298016" in the "Applicant_Data" collection.

await a8data.Applicant_Data.delete(16298016)