We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
This filter works.
filter = { where: { foo: 'foo' } }; model.find(filter, (err, rslt) => { /* ... */ });
But this doesn't.
filter = { where: { and: [ { foo: 'foo' }, { bar: 'bar' } ]}}; model.find(filter, (err, rslt) => { /* ... */ });
The text was updated successfully, but these errors were encountered:
hmm, it works for me: Use example https://github.com/strongloop/loopback-example-database Add another property in model Account called branch With some sample data(see reference), try node . and open explorer:
Account
branch
node .
Endpoint GET/ Account with filter
GET/ Account
{"where": {"and": [{"email": "email1"}, {"branch": "branch1"}]}}
Result:
[ { "email": "email1", "branch": "branch1", "id": "93f63326e1bbe187e10d873620377013" }, { "email": "email1", "branch": "branch1", "id": "93f63326e1bbe187e10d873620376e5b" }, { "email": "email1", "branch": "branch1", "id": "48eb5295643f29caeae9009d2b3719f4" } ]
Reference:
[ { "email": "email2", "branch": "branch2", "id": "c4f513eceaa8647d85fcb99b64294d68" }, { "email": "email1", "branch": "branch1", "id": "93f63326e1bbe187e10d873620377013" }, { "email": "email1", "branch": "branch1", "id": "93f63326e1bbe187e10d873620376e5b" }, { "email": "email1", "branch": "branch2", "id": "bf769780771cbff99efae668242cf8ec" }, { "email": "email1", "branch": "branch1", "id": "48eb5295643f29caeae9009d2b3719f4" } ]
Sorry, something went wrong.
@ka-miyake It works for me, see my comment in #49 (comment) If you still run into this issue, please fork https://github.com/strongloop/loopback-sandbox and provide your app to reproduce the error.
I am closing it now, feel free to reopen it with the sandbox. Thanks.
jannyHou
No branches or pull requests
This filter works.
But this doesn't.
The text was updated successfully, but these errors were encountered: