In MongoDB, you can use JSON-style objects such as in the following to query a collection:
db.things.find({ x : { $ne : 3 }, y : 'foo' });
I'd like to reuse that { x : { $ne : 3 }, y : 'foo' }
bit and use it to filter an array of JavaScript objects.
Is there any code/library out there that can do that, and that supports all the query options (or as much as makes sense anyway)?