Dark Mode

Let's check that the document was inserted.Send a GET request to /api/rest/v2/namespaces/myworld/collections/fitness to retrieve all the documents:

The page-size parameter is included to get all the documents, rather than thelast inserted document.The pageState is useful for pagination of the results in queries.

Let's check that the data was inserted for a particular document.Send a GET request to /api/rest/v2/namespaces/myworld/collections/fitness/undefined to retrieve the document:

It is possible to get a value for a particular field in a document using one oftwo methods, either a where clause or a document-path.These methods can retrieve information from a document or a sub-document.

Most data retrieval uses a WHERE clause containing operators to designate a range of rows to return.

The operators available are:

  • eq (equal)
  • notEq (not equal) - limited use
  • gt (greater than)
  • gte (greater than or equal to)
  • lt (less than)
  • lte (less than or equal to)
  • in (within) - limited use
  • nin (not within) - limited use

The WHERE clause can use any of these operators, as applicable to the data type defined.The storage schema used by the Document API internally indexes all values, so any column can beused with an operator.

Now let's search for a particular document using a WHERE clause.Send a GET request to`/api/rest/v2/namespaces/myworld/collections/fitness?undefined`to get the same information:

Note that the where clause must be url encoded, so curly brackets are escapedwith and spaces must be replaced with %20`.Also, the full document is returned, as opposed to the value of the field specified in the undefined like the next command.

You can also search with a multiple where clause.Send a GET request to`/api/rest/v2/namespaces/myworld/collections/fitness?undefined`to get the same information:

You can also retrieve documents using a WHERE clause that searches sub-documents:

Multiple where can be used in a variety of cases.Here, a numerical value between to values is sought:

To find a particular value, send a GET request to /api/rest/v2/namespaces/myworld/collections/fitness/undefined/undefined to retrieve the type of weights Joey has done in his workout:

In this case, the sub-document weights is the document-path specified to retrieve that data about the reps , type , and weight .

Let's add another record for the next example:

To find particular values, send a GET request to /api/rest/v2/namespaces/myworld/collections/fitnessundefined to retrieve all the users that have, say, weight reps between 11 and 16: