[SERVER-671] distinct don't use object's keys inside of arrays ("dot notation" doesn't work) Created: 24/Feb/10  Updated: 12/Jul/16  Resolved: 29/Mar/10

Status: Closed
Project: Core Server
Component/s: Querying
Affects Version/s: 1.1.2, 1.2.3, 1.3.2
Fix Version/s: 1.5.0

Type: Bug Priority: Major - P3
Reporter: Ilya Remizov Assignee: Mathias Stearn
Resolution: Done Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

OSX 10.6.2 x64


Backwards Compatibility: Major Change
Participants:

 Description   

I'm trying to get distinct values for keys inside of array:

> use test
switched to db test
> db.coll.insert({foo:[

{bar1: "baz11"}

,

{bar1: "baz22"}

]});
ObjectId("4b853fad1ee5c842365f1d6e")
> db.coll.find();
{ "_id" : ObjectId("4b853fad1ee5c842365f1d6e"), "foo" : [

{ "bar1" : "baz11" }

,

{ "bar1" : "baz22" }

] }
> db.coll.distinct("foo.bar1");
[ ]

I get empty result, but I'm waiting for [ "baz11", "baz22" ] because of "dot notation"



 Comments   
Comment by Kabriel Robichaux [ 15/Jul/10 ]

Any chance this could get a backport to 1.4 line so we can get a fix for this for current production environments?

Comment by Eliot Horowitz (Inactive) [ 26/Apr/10 ]

in a release

Comment by Mathias Stearn [ 29/Mar/10 ]

This could be backward breaking if you were depending on getting a list of distinct arrays.

Comment by auto [ 29/Mar/10 ]

Author:

{'login': 'RedBeard0531', 'name': 'Mathias Stearn', 'email': 'redbeard0531@gmail.com'}

Message: Support Arrays with distinct SERVER-671
http://github.com/mongodb/mongo/commit/03c08deb4437d2b958af6256c682f831b3dfb874

Generated at Thu Feb 08 02:54:50 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.