From cb78c8ef96c69d7699588bf91f1ece0654541904 Mon Sep 17 00:00:00 2001 From: Laurent Villeneuve Date: Thu, 27 Aug 2015 23:56:49 -0400 Subject: [PATCH] Add direct copmarison value for array matching --- test/memory.test.js | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/test/memory.test.js b/test/memory.test.js index fb6f655c..c16c2ea1 100644 --- a/test/memory.test.js +++ b/test/memory.test.js @@ -309,10 +309,10 @@ describe('Memory connector', function() { }); }); - it('should successfully extract 2 users matching array values', function (done) { + it('should successfully extract 2 users matching over array values', function (done) { User.find({ where: { - 'children': { + children: { regexp: /an/ } } @@ -325,6 +325,19 @@ describe('Memory connector', function() { }); }); + it('should successfully extract 1 users matching over array values', function (done) { + User.find({ + where: { + children: 'Dhani' + } + }, function (err, users) { + should.not.exist(err); + users.length.should.be.equal(1); + users[0].name.should.be.equal('George Harrison'); + done(); + }); + }); + it('should count using date string', function(done) { User.count({birthday: {lt: new Date(1990,0).toISOString()}}, function(err, count) {