Skip to content

Instantly share code, notes, and snippets.

@jeffyuhaoliu
Created September 8, 2013 17:49
Show Gist options
  • Save jeffyuhaoliu/6486879 to your computer and use it in GitHub Desktop.
Save jeffyuhaoliu/6486879 to your computer and use it in GitHub Desktop.
Node.js MongoDB HW#4.3 - This array shows the indexes that were created to answer HW#4.3. Note: To create an index, run the following command... db.posts.ensureIndex({date: -1}) db.posts.ensureIndex({tags: 1, date: -1}) db.posts.ensureIndex({permalink: 1})
[
{
"v" : 1,
"key" : {
"_id" : 1
},
"ns" : "blog.posts",
"name" : "_id_"
},
{
"v" : 1,
"key" : {
"date" : -1
},
"ns" : "blog.posts",
"name" : "date_-1"
},
{
"v" : 1,
"key" : {
"tags" : 1,
"date" : -1
},
"ns" : "blog.posts",
"name" : "tags_1_date_-1"
},
{
"v" : 1,
"key" : {
"permalink" : 1
},
"ns" : "blog.posts",
"name" : "permalink_1"
}
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment