redgeoff / mson

🏗️MSON Lang: Generate an app from JSON
Apache License 2.0
471 stars 33 forks source link

Support for basic operators in template values #200

Closed redgeoff closed 3 years ago

redgeoff commented 5 years ago

To be able to support configurations like https://github.com/redgeoff/mson/issues/183 in a more streamlined way, we can use operators like !, +, -, /, *, %, =, &, |

redgeoff commented 5 years ago

An alternative to this is to support a notation like mongo queries, which may be more declarative

redgeoff commented 5 years ago

The more I think about this, he more that I think we want to use mongodb-style queries so that it can more easily be customized by a UI in the future. The lib https://github.com/kofrasa/mingo, may help

redgeoff commented 4 years ago

Here is a POC using a MongoDB aggregation

Or, a POC for more specifically for negating a boolean.

redgeoff commented 4 years ago

And here is a POC that uses mingo that should work, but appears to be broken because of this bug

redgeoff commented 3 years ago

Example of a conditional operator (ternary) using Mongo Queries

redgeoff commented 3 years ago

Proof of Concept for adding support for Mingo aggregations

redgeoff commented 3 years ago

Implemented by https://github.com/redgeoff/mson/pull/306. And, here is some documentation