What do you think about add like and notLike operator to query ?
It could be a good optimization for applications with search feature in large amount of data.
commentCollection.query(
Q.where('label', Q.like('a%')),
)
this should be possible, not super difficult, but not trivial either. If someone wants to implement this, I can give guidance as for where to start
I'm ok to implement it. Can you give me some advice ?
Sure, you need these parts:
Model object matches a query or not. This is necessary for observing queries. More details here: https://github.com/Nozbe/WatermelonDB/issues/15#issuecomment-419713849__tests__/databaseTests that checks every single operator on every supported database to see if it actually works@radex My first PR to WatermelonDB has been sent 🙂. I'm waiting for your feedback
Hello, great work guys.
While this is not approved yet, is there any alternative way of doing a LIKE query ? I really need this feature to implement a filter by Customer Name in my App.
Thanks.
@sonikro if it needs to be a fuzzy search… no good solution comes to mind, sorry. I suggest you temporarily use the Watermelon fork @ieschalier has. His PR is almost ready, should work fine — but might take a week or two until it's realeased
Thanks @radex , that's exactly what Im doing right now.
EDIT: Also, thanks @ieschalier for developing it :+1:
merged and shipped. cc @sonikro
Most helpful comment
Sure, you need these parts:
Modelobject matches a query or not. This is necessary for observing queries. More details here: https://github.com/Nozbe/WatermelonDB/issues/15#issuecomment-419713849__tests__/databaseTeststhat checks every single operator on every supported database to see if it actually works