Closed woojoo666 closed 2 years ago
with MongoDB I can create a document like
{ name: { first: 'Bob' } }
and then query it using find({ name: { $eq: { first: 'Bob' } } })
find({ name: { $eq: { first: 'Bob' } } })
However this doesn't seem to work in LokiJS. I tried this piece of code in the official sandbox:
var db = new loki('sandbox.db'); var items = db.addCollection('items'); items.insert({ name: { first: 'Bob' } }); logObject(items.find({ name: { $eq: { first: 'Bob' } } }));
And the query returned no results. I also tried items.find({ name: { $eq: { first: { $eq: 'Bob' } } } }), but that didn't work either.
items.find({ name: { $eq: { first: { $eq: 'Bob' } } } })
You can also see it running live at codesandbox
Does LokiJS support such queries? And if not, what's the alternative?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
with MongoDB I can create a document like
and then query it using
find({ name: { $eq: { first: 'Bob' } } })
However this doesn't seem to work in LokiJS. I tried this piece of code in the official sandbox:
And the query returned no results. I also tried
items.find({ name: { $eq: { first: { $eq: 'Bob' } } } })
, but that didn't work either.You can also see it running live at codesandbox
Does LokiJS support such queries? And if not, what's the alternative?