Skip to content

Instantly share code, notes, and snippets.

@danieltahara
Created July 14, 2012 22:11
Show Gist options
  • Save danieltahara/3113662 to your computer and use it in GitHub Desktop.
Save danieltahara/3113662 to your computer and use it in GitHub Desktop.
Mongodb - Indexing Embedded Documents
Indexing on Embedded Fields("Dot Notation")
With MongoDB you can even index on a key inside of an embedded document. Reaching into sub-documents is referred to as Dot Notation. For example:
db.things.ensureIndex({"address.city": 1})
@danieltahara
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment