0

I'm pretty sure I have read somewhere that there might be problems/bugs regarding creating indexes with nested objects. Like this:

db.bookings.ensureIndex({"staff._id": 1, "start": 1, "end": 1})

Can someone please confirm or deny this?

I can't seemt to find anything online confirming possible problems/bugs. And the index seems to be in use when I run a test query with explain()?

2
  • Is staff an array or just a nested object? Commented Jan 28, 2015 at 14:55
  • It's just a nested object... Commented Jan 28, 2015 at 15:18

1 Answer 1

1

You're not finding anything because indexes that reference fields of nested objects operate the same as ones that only reference top-level fields.

You may be recalling some of the potential issues you can face when including a field of an object that's nested within an array. That's when things can get messy. See http://docs.mongodb.org/manual/core/index-multikey/#limitations

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.