adewes / blitzdb

Blitz is a document-oriented database for Python that is backend-agnostic. It comes with a flat-file database for JSON documents and provides MongoDB-like querying capabilities.
http://blitzdb.readthedocs.org
MIT License
330 stars 37 forks source link

Syntax for Keyword Searching (LIKE in SQL) #69

Open blesson3 opened 7 years ago

blesson3 commented 7 years ago

What is the syntax for filtering by wildcard using a FileBackend?

Ex. I have a Dog document class that has one object persisted with the properties of { 'name':'fido', 'color':'brown', 'owner':'Joe Smith' } I want to be able to filter through all of the persisted dog objects with a wildcard like so, dogs = backend.filter(Dog, { 'owner': { '$LIKE': 'Joe%' } }) and have the object specified above to be returned in an array.

Is this already supported in any fashion? If not, then is there any movement to support this?

blesson3 commented 7 years ago

Found that the Advanced Querying operators include the $regex operator, which is not found in the tutorial documentation https://github.com/adewes/blitzdb/blob/master/docs/source/tutorials/basics.rst#advanced-querying

johnnyutahh commented 7 years ago

Can the Blitz team confirm the above comment is a supported and recommended approach for now and the future to solve this issue?