Created
May 6, 2015 14:52
-
-
Save dalmat36/b9019547f2b6ea21e150 to your computer and use it in GitHub Desktop.
Webinar: Introduction to using MongoDB and Spring Data on Cloud Foundry Secondary Indexes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //1 means ascending, -1 means descending | |
| db.posts.ensureIndex({author:1}) | |
| db.posts.find({author:'roger'}).pretty() | |
| Result: | |
| { | |
| "_id" : ObjectId("554a2380df506c53b1a78647"), | |
| "author" : "roger", | |
| "date" : ISODate("2015-05-06T14:21:24.537Z"), | |
| "text" : "about mongodB...", | |
| "tags" : [ | |
| "tech", | |
| "databases" | |
| ] | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment