Skip to content

Instantly share code, notes, and snippets.

@dalmat36
Created May 6, 2015 14:52
Show Gist options
  • Select an option

  • Save dalmat36/b9019547f2b6ea21e150 to your computer and use it in GitHub Desktop.

Select an option

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
//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