-
Notifications
You must be signed in to change notification settings - Fork 365
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support embedded query in memory connector. Fix memory connector bug #697
Support embedded query in memory connector. Fix memory connector bug #697
Conversation
Adds support for the ability to query embedsMany models from the parent. Fix a memory connector bug that could occur when having an "or" or "and" clause combined with another property. In that case, the and would revert true for 'Paul McCartney' ``` {name:'John Lennon',and: [{role:'lead'}, {vip:true}]}} ```
@altsang Are you in a position to give me an ETA for the review/merge. Also, is this something that you can accept? |
@mazesoul Thank you for the patch! Contributions are always welcome!
If we allow and/or to be used with regular clauses, we need to make sure other connectors support it too.
|
@raymondfeng The memory connector didn't support nested properties over arrays. Like this https://github.com/WyzeLink/loopback-datasource-juggler/blob/feature/support-embedded-query-in-memory/test/memory.test.js#L431-L439. Where friends is an array of object. This is important to be able to test embedsMany relations Concerning the support for the and/or clauses, from what I can gather the SQL connectors all default to loopback-connector's Moreover, in the memory connector's implementation, there was a bug even if it doesn't support both. If the
As for mongo, its where build is additive: https://github.com/strongloop/loopback-connector-mongodb/blob/master/lib/mongodb.js#L553 |
And finally, a bug which I forgot to mention in the PR's comment: supposing there are two objects, only one of which having a value for a string key, the regex match would throw because there was no verification: https://github.com/strongloop/loopback-datasource-juggler/pull/697/files#diff-98aa884e786e8c02d53648b6f0afaa82R481 It would be trying |
…in-memory Support embedded query in memory connector. Fix memory connector bug
Thanks :) |
Adds support for the ability to query embedsMany models from the parent.
Fix a memory connector bug that could occur when having an "or" or "and"
clause combined with another property. In that case, the and would revert
true for 'Paul McCartney'