For up-to-date product documentation, see the IBM MobileFirst Foundation Developer Center.
Store internals
See an example of how JSONStore data is stored.
The key elements in this simplified example:
- _id is the unique identifier (for example, AUTO INCREMENT PRIMARY KEY).
- json contains an exact representation of the JSON object that is stored.
- name and age are search fields.
- key is an extra search field.
Example
Table 1. Contents of a store in JSONStore _id key name age JSON 1 c carlos 99 {name: 'carlos', age: 99} 2 t time 100 {name: 'tim', age: 100} When we search by using one of the following queries or a combination of them: {_id : 1}, {name: 'carlos'}, {age: 99}, {key: 'c'}, the returned document is {_id: 1, json: {name: 'carlos', age: 99} }.
The other internal JSONStore fields are:
- _dirty
- Determines whether the document was marked as dirty or not. This field is useful to track changes to the documents. For more information, see JSONStore API concepts or Work with external data.
- _deleted
- Marks a document as deleted or not. This field is useful to remove objects from the collection, to later use them to track changes with your backend and decide whether to remove them or not.
- _operation
- A string that reflects the last operation to be performed on the document (for example, replace).
Parent topic: Troubleshooting JSONStore