Dot notation is now able to go inside arrays and array indexes

pull/2/head
Louis Chatriot 11 years ago
parent 74ac0bae62
commit 9c26c41ef6
  1. 6
      test/model.test.js

@ -909,6 +909,12 @@ describe('Model', function () {
(function () { model.match({ a: { b: 5 } }, { a: { $or: [ { b: 10 }, { b: 5 } ] } }) }).should.throw();
});
it("Can match for field equality inside an array with the dot notation", function () {
mode.match({ a: true, b: [ 'node', 'embedded', 'database' ] }, { 'b.1': 'node' }).should.equal(false);
mode.match({ a: true, b: [ 'node', 'embedded', 'database' ] }, { 'b.1': 'embedded' }).should.equal(true);
mode.match({ a: true, b: [ 'node', 'embedded', 'database' ] }, { 'b.1': 'database' }).should.equal(false);
})
});

Loading…
Cancel
Save