Details
-
Bug
-
Resolution: Won't Fix
-
Minor - P4
-
None
-
3.3.15
-
None
-
Query
-
ALL
Description
If the group key is a string, the group command should put all documents whose strings compare equal under the collation into the same group. However, the groups are instead determined using a simple binary string comparison. This can be reproduced as follows:
db.c.drop();
|
db.c.insert({_id: 1, str: "foo"});
|
db.c.insert({_id: 2, str: "FOO"});
|
db.c.insert({_id: 3, str: "bar"});
|
db.c.insert({_id: 4, str: "BAR"});
|
|
|
db.c.group({
|
key: {str: 1},
|
initial: {count: 0},
|
reduce: function(curr, result) { result.count += 1; },
|
collation: {locale: "en", strength: 2}
|
});
|
I would expect this to return 2 groups under the English case-insensitive collation, but instead the server returns 4.
Attachments
Issue Links
- related to
-
SERVER-26426 mapReduce key comparisons do not respect the collation
-
- Closed
-