Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Contains Filter not available #10

Closed
fvisticot opened this issue Nov 24, 2018 · 4 comments
Closed

Contains Filter not available #10

fvisticot opened this issue Nov 24, 2018 · 4 comments

Comments

@fvisticot
Copy link

The db is containing model with firstName, lastName.
I need to query by firstName containing a pattern

@alextekartik
Copy link
Collaborator

There is not convenient way to do that yet but I could easily add a way to query using a RegExp or glob pattern (I like glob as I can easily read it but it is more file name oriented and RegExp seems more powerful)

@Benoss
Copy link

Benoss commented Nov 27, 2018

I would love one or the other, my use case it for implementing startsWith(string), can already do it by doing lessThan and greaterThan but a bit inefficient .

@alextekartik
Copy link
Collaborator

Ok indeed RegExp pattern should be the more generic. I will tackle that later this week.

@alextekartik
Copy link
Collaborator

I have added reg exp pattern matching using Filter.matches. It can be used to perform filters like contains, startsWith, endsWith and of course many more assuming you speak regular expression fluently (which is not my case).

Some docs here: https://github.com/tekartik/sembast.dart/blob/master/doc/queries.md#filtering-using-regexp-patten

Published in 1.12.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants