Honour allowExtendedOperators in "DAO.find"#1180
Conversation
|
The first commit is from #1179, I'll rebase it away. |
f0f199b to
d861b04
Compare
| // we have to build a new object for each test | ||
| return {where: {value: {$exists: true}}}; | ||
| } | ||
|
|
| }; | ||
| callback(null, [instanceFound]); | ||
| } | ||
| } |
There was a problem hiding this comment.
Why are these declared outside describe and extendedQuery is inside? Put all inside or put all outside for consistency?
There was a problem hiding this comment.
I agree... It seems reasonable to have consistency...
There was a problem hiding this comment.
extendedQuery is specific to DAO.find test cases only.
The rest is more generic and can be used in the future e.g. for DAO.updateAttributes tests that are missing now (the implementation is already in place though).
I moved them from the root scope into the describe block for consistency.
| }; | ||
| callback(null, [instanceFound]); | ||
| } | ||
| } |
There was a problem hiding this comment.
I agree... It seems reasonable to have consistency...
|
@bajtos |
Modify the coercion of filter.where to hounour "allowExtendedOperators" and don't coerce property values of type object (extended operators).
d861b04 to
779cf6a
Compare
@Amir-61 Yes, we can and should use ES6 in Note that when back-porting changes to older versions (typically 1.x and 2.x), we should stick to ES5, to make sure we don't break LoopBack for people still running on pre-v4 versions of Node. |
Modify the coercion of filter.where to hounour "allowExtendedOperators" and don't coerce property values of type object (extended operators). This allows MongoDB users to query using MongoDBs operators like
{ $exists: true, $ne: null }.See strongloop/loopback#646
@raymondfeng @superkhau or @Amir-61 please review
@fabien IIRC, you are using MongoDB quite a lot. Could you please take a look too?