zebzhao / Angular-QueryBuilder

A modernized Angular 4+ query builder based on jquery QueryBuilder
MIT License
292 stars 222 forks source link

Test object against constructed query #68

Closed khanyuriy closed 5 years ago

khanyuriy commented 5 years ago

Hi! Is there any way to test my javascript collection of objects against a built query?

I found converting query to sql, to mongo plugins. Documentation said that there is parsers for backends. But where is the parser for frontend? How to test vanilla javascript array of objects?

Thanks!

zebzhao commented 5 years ago

Correct me if I'm wrong, do you want to convert the built query back to objects? The library is just a simple UI component and does not handle any logic for converting to queries or back.

khanyuriy commented 5 years ago

Hi! I want method, that can check if object match query, built with this builder.

IsMatch(query, object) = true/false; arrayOfObjects.map(obj => IsMatch(query, obj)) = array of matched objects.

пт, 5 окт. 2018 г., 3:48 zebzhao notifications@github.com:

Correct me if I'm wrong, do you want to convert the built query back to objects? The library is just a simple UI component and does not handle any logic for converting to queries or back.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/zebzhao/Angular-QueryBuilder/issues/68#issuecomment-427213400, or mute the thread https://github.com/notifications/unsubscribe-auth/ACrODV5O1jiLeQqW9yniFd76WBUHOT_Yks5uhqxSgaJpZM4XB7Xe .

zebzhao commented 5 years ago

I think this feature is beyond the scope of this library. Not everyone using this library will find this feature useful if they are querying a database instead of doing object matching in the browser. If anyone thinks otherwise please reopen this issue.

Delink-D commented 5 years ago

This would be useful to us, a method to parse an object by passing in the object and the rules. Similar to jsonlogic.apply