Re: Distinct on array of embedded documents doesn't use index?

From: Adam Dohnal <dohnal.adam@xxxxxxxxx>
To: mongodb-user <mongodb-user@xxxxxxxxxxxxxxxx>
Date: Mon, 25 Apr 2016 01:21:13 -0700 (PDT)
Why ads?


db.items.getIndexes()

[

{

             "v" : 1,

              "key" : {

                     "_id" : 1

             },

            "name" : "_id_",

              "ns" : "local.items"

  },

    {

             "v" : 1,

              "key" : {

                     "stock.size" : 1

              },

            "name" : "stock.size_1",

              "ns" : "local.items"

  }

]

db.items.distinct("stock.size")

[ "M", "S" ]

db.items.distinct("stock.size").explain();

2016-04-25T10:19:42.731+0200 E QUERY    TypeError: Object M,S has no method 
'explain'

   at (shell):1:33

-- 
You received this message because you are subscribed to the Google Groups "mongodb-user"
group.

For other MongoDB technical support options, see: https://docs.mongodb.org/manual/support/
--- 
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 https://groups.google.com/group/mongodb-user.
To view this discussion on the web visit https://groups.google.com/d/msgid/mongodb-user/6217898d-abbe-4c44-b987-86029ed5e8b7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Why ads?