Here is my db.find():
db.createIndex({
index: {
fields: [\'username\', \'date\'],
name: \'usernameDateIndex\',
ddoc: \"usernameDateIndex\"
}
Take a loot at this answer, according to item 2 of the answer:
- At query time, an index can only be used if all it's indexed fields are required to exist according to the selector. For example, if your index contains fields A and B but you only query for A, we can't use the index because it won't include documents that contain A but not B.
Maybe that's the cause of your issue.