Skip to content
This repository has been archived by the owner on Mar 17, 2023. It is now read-only.

Change query structure from JSON to EJSON #1001

Merged
merged 2 commits into from
Feb 11, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions developer-guides/rest-api/query-and-fields-info/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ To query the users which has a name that has `g` in it somewhere.

`https://localhost:3000/api/v1/users.list?query={ "name": { "$regex": "g" } }`

**Note** <br/>
The allowed structure is [EJSON](https://docs.meteor.com/api/ejson.html), which is similar to JSON, except in the `Date` and `binary` fields. For query objects that use `Date` fields, you should use the structure as the example below:
`query={"_updatedAt": {"$gt": { "$date": 1542814057 } }}` or
`query={"_updatedAt":{"$gt":{"$date":"2018-11-21T15:27:28.202Z"}}}`

## Fields Example

To only return the usernames for users, you would do something like this:
Expand Down