App42 back-end platform provides easy interface to save your app data in form of JSON objects using Storage API. Your JSON app data is saved inside a given collection and database. Here collection is like a table and your JSON object represent row inside that collection. Your App can have only a single db and as many collections inside it.
To save your JSON app data, collection name and JSON object that you want to save. If you are saving JSON object first time, a new database (named as App42DB) and collection is created automatically. If you want to create database by your own (AppHQ Console > Technical Service > Storage Service > Add DB), make sure you name it as App42DB. You are allowed to create only one DB per app however you can have multiple collections inside your app database. To save your JSON app data, you have to pass your LClassName and JSON object that you want to save. Once your JSON object is saved, you will get an unique identifier objectId of stored json object.
All stored JSON object can be viewed inside AppHQ console under Technical Service > Storage Service option.
Once your app data is stored in App42 cloud in JSON objects also referred as JSON documents, you can query your data using finder methods available in Storage API. There are several ways of fetching stored objects, like if you want to fetch objects based on multiple conditions (like where clause in SQL), you can use query interface to write those conditions and fetching target objects as shown in below code snippet. If you want to fetch objects which has age value less than or equal to 25 and company value as ShepHertz, you can pass following snippet as shown below.
Query Operators Below are the query operators that can be used while query the object
While saving the user data, one can define the ACL on saved data as shown below. You have to first create TJSONObject with defined permission as explained and pass this while saving the data.
If you want to fetch object by passing meta object and associated value of it. Find object is the best way to find your document on App42 Cloud database.
Update your target JSON document. The TJSONObject will be searched in the JSON doc stored in the cloud and matching doc will be updated with the new value passed.
Remove your JSON data which has been stored on App42 Cloud database.