A. How do I index nested and all of it's values?
nested
B. How do I index valuetwo?
valuetwo
{ id: 00000, attrs: { nested:{ value: value1, valuetwo: value2, } } }
I've looked here: http://www.mongodb.org/display/DOCS/Indexes, and the docs to my knowledge, aren't clear about indexing things that aren't nested.
You'd create them just as if you were creating an index on a top level field:
db.collection.createIndex({"attrs.nested.value": 1})
You do need to explicitly create indexes on each field.
1.4m articles
1.4m replys
5 comments
57.0k users