[mongodb-user] Re: Distinct on array of embedded documents doesn't use index?
Re: Distinct on array of embedded documents doesn't use index?
Rhys Campbell <
Mon, 25 Apr 2016 04:28:09 -0700 (PDT)
OK, so no explain for this method then!
This looks like the reason...
any of the indexed fields in any of the documents in the collection
includes an array. If an indexed field is an array, the index becomes a multi-key
cannot support a covered query.
Have you tried the aggregate framework? Perhaps you'll have between luck
with that to avoid this. $match and then grouping to a distinct list will
probably use indexes.
You received this message because you are subscribed to the Google Groups "mongodb-user"
For other MongoDB technical support options, see:
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-user+unsubscribe@xxxxxxxxxxxxxxxx.
To post to this group, send email to mongodb-user@xxxxxxxxxxxxxxxx.
Visit this group at
To view this discussion on the web visit
For more options, visit
for more updates.