Appbase Javascript API¶
Brief Overview¶
The Appbase data model is represented as a graph. Vertices are used for storing and retrieving primitive data, and linked to other vertices using edges. Read more about it in the overview document.
Appbase Datatypes
Primitive
- Boolean
- Number
- String
Objects
-
- Appbase Reference
- Reference to a vertex on a given Appbase path.
-
- Vertex Snapshot
Appbase Object¶
Appbase is the global object exposed to the Javascript namespace. It has three methods credentials(), create(), ref() and search().
Appbase Reference¶
Appbase Reference has methods for writing, and reading (listening) on the Appbase graph.
.setEdge() setEdge(dest_ref, edgename, [priority], [callback])¶
.removeEdge() removeEdge([name1, ...], [callback])¶
Data Listeners¶
Data Snapshots¶
Data snapshots are immutable copies of the data stored at `Appbase References`_. There are two kinds of snapshots: Property Snapshot and Edge Snapshot, fired when listening to on(‘properties’) or one of the edge listeners.