-
-
Notifications
You must be signed in to change notification settings - Fork 54
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
Does it support running rules on complex objects? #30
Comments
Your best bet is going to be in the Getting Started page. https://zerosteiner.github.io/rule-engine/getting_started.html What your showing should work with the default getitem resolver. You can experiment with it using the debug repl https://zerosteiner.github.io/rule-engine/debug_repl.html I'm enjoying the holidays now and won't be able to provide a more detailed example until I'm back at my computer next week. I don't see any issue with the example you provided yourself. All the data types I see are fully supported. |
Here's a larger example using the debug repl.
You can access MAPPING keys using the dot syntax like |
Thank you for this example. It's very helpful. In the below example, is it possible to match all users whose friends association == 'school' `
|
Yeah you should be able to use array comprehension (like Python's own list comprehension) to do that. https://zerosteiner.github.io/rule-engine/syntax.html#array-comprehension Something like: The resulting expression will be a list so you can check the length on it and do stuff like that. |
In my specific case, I am trying to create a generic function that can filter a list without knowing the type of objects it has. Thanks for answering my questions. |
Cool so it sounds like you're all set so I'll close this out. If you have any other questions just post them here or in a new issue if you'd like. |
Does it support running rules on complex objects? Like running rules on address.country == 'USA"?
{ "name": "test_user", "email_address": "test@gmail.com", "address": { "address_1": "high st", "address_2": "unit-4", "state": "AZ", "country": "USA" } }
Can you give an example as i see complex types are supported
The text was updated successfully, but these errors were encountered: