mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
Fix non-array fields with array fields
This commit is contained in:
@@ -1814,6 +1814,9 @@ Tinytest.add("minimongo - sort keys", function (test) {
|
||||
testKeys({'a.x': 1, 'a.y': 1},
|
||||
{a: [{x: 0, y: 5}, {x: 1, y: 3}]},
|
||||
[[0,5], [1,3]]);
|
||||
testKeys({'a.x': 1, 'a.y': 1, b: -1},
|
||||
{a: [{x: 0, y: 5}, {x: 1, y: 3}], b: 42},
|
||||
[[0,5,42], [1,3,42]]);
|
||||
});
|
||||
|
||||
Tinytest.add("minimongo - binary search", function (test) {
|
||||
|
||||
@@ -189,8 +189,10 @@ _.extend(Minimongo.Sorter.prototype, {
|
||||
});
|
||||
|
||||
if (knownPaths) {
|
||||
// Similarly to above, paths must match everywhere.
|
||||
if (_.size(knownPaths) !== _.size(valuesBySomething[whichField])) {
|
||||
// Similarly to above, paths must match everywhere, unless this is a
|
||||
// non-array field.
|
||||
if (!_.has(valuesBySomething[whichField], '') &&
|
||||
_.size(knownPaths) !== _.size(valuesBySomething[whichField])) {
|
||||
throw Error("cannot index parallel arrays!");
|
||||
}
|
||||
} else if (usedPaths) {
|
||||
|
||||
Reference in New Issue
Block a user