diff --git a/packages/minimongo/minimongo_tests.js b/packages/minimongo/minimongo_tests.js index 706907c6e99..d1629e40f8b 100644 --- a/packages/minimongo/minimongo_tests.js +++ b/packages/minimongo/minimongo_tests.js @@ -798,6 +798,7 @@ Tinytest.add("minimongo - selector_compiler", function (test) { match({"dogs.0.name": "Fido"}, {dogs: [{name: "Fido"}, {name: "Rex"}]}); match({"dogs.1.name": "Rex"}, {dogs: [{name: "Fido"}, {name: "Rex"}]}); nomatch({"dogs.1.name": "Fido"}, {dogs: [{name: "Fido"}, {name: "Rex"}]}); + match({"room.1b": "bla"}, {room: {"1b": "bla"}}); // XXX still needs tests: // - $elemMatch diff --git a/packages/minimongo/selector.js b/packages/minimongo/selector.js index e462b5e6113..4d4e33c6b3b 100644 --- a/packages/minimongo/selector.js +++ b/packages/minimongo/selector.js @@ -398,7 +398,7 @@ LocalCollection._exprForKeypathPredicate = function (keypath, value, literals) { while (keyparts.length) { var part = keyparts.pop(); var thisPartIsNumber = false; - if (/^\d+/.test(part)) { + if (/^\d+$/.test(part)) { part = +part; thisPartIsNumber = true; }