Is there a javascript library that will allow me to express object predicates in a DSL similar to MongoDB\'s query language? For the sake of clarity in a large program, I\'d
OK I found the answer: Sift.js
Now for the long answer: This has been asked and answered before. The salient points are:
filter() for example.As a final note, mongodb-riff appears to be trying to do something similar but currently the page states clearly that it doesn't work - perhaps it's abandoned. But his readme is at least of value :-), he mentions sift and Query Engine which looks more mature, though too complicated for me!
Personally I'm going to go with Underscore because now that I've looked into it for the first time, I realise that it has heaps of handy stuff I need, plus I really only wanted to do simple functions like what would be _.find() in Underscore. But I guess if you want to do more complicated mongo-like queries, you'll do it in less LOC with Sift.