techfort/LokiJS

can't query for nested object equality

woojoo666 opened this issue · 1 comments

with MongoDB I can create a document like

{ name: { first: 'Bob' } }

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:

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.

You can also see it running live at codesandbox

Does LokiJS support such queries? And if not, what's the alternative?

stale commented

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.