Platform Manual
Document Model
Fields and Key-Values
a document consists of sets of fields that self describe the data it encodes each set signifies a single pair of two associated elements the name identifying the data ( /#field property ) the value that holds the actual data to store ( /#field values ) required and randomly generated and assigned by default upon creation, the first set of fields identify the document for more information, see docid 67wjvnr54pfmmae2wre3s , as follows field property similar to most document oriented databases, you can only use strings to encode field names in documents if you attempt to insert a type other than a string for a field property, as demonstrated in the following snippet, you will receive an error message { 1 "numeric fields are invalid here", "this part" "numeric fields are valid here" } field values values can be encoded using various data types, providing flexibility in representing a wide range of information; however, the supported data types depend on the type of crdt you are using for a register , use any type such as strings , numbers , objects , or even binary data for a counter , use only a number if embedding a map , use key value pairs within the embedded structure for an overview of write behavior by type, see docid\ yxemkh1com3csuumqcnlf sorting by field sort the results in a specific order by using the sort method to specify the field for matching and the desired order of the matching query results by default, queries that do not include a sort operation, filter by document id limiting by field restrict the number of results returned by your query by using the limit method to specify the number of results you want to return map key value pairs establishes a parent child hierarchy between data elements where the key serves as the parent and the associated values for the children to link related data items as well as organize them in a structure that enhances the efficiency of lookup for more information, see docid\ lqgzvvhtqzybx ald5b8j