bevry / query-engine

QueryEngine provides extensive Querying, Filtering, and Searching abilities for Backbone.js Collections as well as JavaScript arrays and objects
http://bevry.github.io/query-engine/
Other
328 stars 34 forks source link

Support for $regex? #26

Open Reggino opened 11 years ago

Reggino commented 11 years ago

Awesome project, thanks!

When writing a query using the syntax as mentioned here: http://docs.mongodb.org/manual/reference/operator/regex/

query-engine throws an error. To be more specific: the query:

{ field: { $regex: 'acme.*corp', $options: 'i' } }

results in:

Error: Couldn't find the selector $regexp

balupton commented 10 years ago

Hrmm, we don't support that syntax, but we do support regexes, just do {field: /acme.*corp/i} and you'll be good. If someone can mention this in our "differences from mongodb docs" that would be great.

Reggino commented 10 years ago

The only thing is, the former syntax is much easier to serialize for e.g. AJAX requests... Consider a JavaScript browser-application, trying to query on the server, passing that query using AJAX. I think the standardized syntax offers an advantage here.

dcolens commented 10 years ago

Any plans to support $regex ?