Object format.
The Appery.io Database stores data in JSON format (it’s running MongoDB). For example, if you are building a ToDo app, a task object might look like:
{
"priority": "High",
"taskName": "Use cool API"
}
When a new object is created, the following three columns are automatically created: _createdAt, _updatedAt, and _id. These field names are reserved, so you cannot set them yourself. Using the object above, if you did a GET on it, it would look like this, including the reserved fields:
{
"_id":"544fc7f1e4b0c9bce1295c78",
"taskName":"Use Cool API",
"_createdAt":"2014-10-28 16:44:33.374",
"_updatedAt":"2014-10-28 16:44:36.922",
"priority":"high"
}
If the collection name is todo, then the URL to the collection would be:
https://api.appery.io/rest/1/db/collections/todo
If you want to work with a particular object (for instance, the above example), then the URL would be either this:
https://api.appery.io/rest/1/db/collections/todo/[object_id].
Or this:
https://api.appery.io/rest/1/db/collections/todo/544fc7f1e4b0c9bce1295c78
To make it easy to work with collections and objects, you can get the almost-complete curl command for each REST verb. Click on any of the REST verbs (GET, FIND, CREATE, UPDATE, DELETE) to get the curl request.
Number of records
There is a default limit parameter which equals 100. That means that only 100 records will be returned if other wasn’t specified. To avoid this limitation, use the limit parameter in the requests and specify your own value. Max value is 1500.
For more precise examples, documentation below uses Students collection with following structure:
studentName | studentId | marks |
---|---|---|
string | number | array |
John | 10 | [10,9,3] |
Donna | 20 | [2,8,1] |
... | ... | ... |
Dina | 100 | [10,8,9] |