Commit e97da335 by Nitin Dhar

Adding a readme section on the 'sort' constraint with an example of how to use it

parent 8e7e5ced
......@@ -94,6 +94,14 @@ One can apply a "query" contraint, which takes a standard Mongo query object, to
$ mongo test --eval "var collection = 'users', query = {'caredAbout':true}" variety.js
### Analyze Documents Sorted in a particular order ###
Perhaps you want to analyze a subset of documents sorted in an order other than creation order, say, for example, sorted by when documents were updated.
One can apply a "sort" constraint, which analyzes documents in the specified order like so:
$ mongo test --eval "var collection = 'users', sort = { updated_at : -1 }" variety.js
##### "But my dad told me MongoDB is a schemaless database!" #####
First of all, your father is a great guy. Moving on...
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment