-
Notifications
You must be signed in to change notification settings - Fork 476
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
Search in Arrays #91
Comments
(removed) |
Sorry... I should have read more carefully. Currently 'no', our dot notation currently does not work on arrays. This seems to be something we could add without too much effort so I will look into adding it over the next few days or so. Until then you could use 'where' clauses which use javascript filter functions to do this filtering. |
I did initial checkin of changes which support your example. In doing so I noticed dot notation may not be detecting properly when you include an operator. I'll work on that next but in meantime, form your query with implicit equals operator like : coll.find({'topics.id', 3}); If you prefer to wait I will probably do further testing and fix operator detection over the next few days. |
Hi, thanks for your work! I will not be able to use it for my current project, but it will be helpful in the future. Best regards |
No problem. Seems explicit operators ('$eq', '$gt', '$lt'...) work fine. Added test cases which validate this subarray searching, so closing issue. |
I have a array in my documents:
///
{
title: 'test',
topics: [{id: 1, title: 'topic1'}, {id:3, title: ' topic3'}]
}
///
Is it possible to search for documents where topics.id = 3.
In mongodb i can do this with 'topics.id': 3. Is it possible to search in arrays like this with loki?
Thanks
Best regards
Dominic
The text was updated successfully, but these errors were encountered: