top | item 38760812

(no title)

xd | 2 years ago

I've a similar way of interacting with the API of my product but instead keep everything prefix notation (lispy) so for example;

"and": [ { "property": "material", "operator": "equals", "value": "carbon" },

Would be;

["and", ["=", "material", "carbon"], ...]

discuss

order

cyptus|2 years ago

Is there any standard for describing filters in json like this, or any well known library that is also able to parse this back to expressions?

egeozcan|2 years ago

In my humble opinion, it would benefit all better if we standardized something like jql (jira query language, so the user layer) first. From experience, many who find sql too complex have no problem with writing complicated jql queries. it's both easy to use and a great first step to writing actual SQL. I wish it was a standard like json.

xd|2 years ago

The way the JSON filters work would be directly coupled to the JSON fix notation and SQL infix notation so it's directly coupled to SQL and doesn't really require a standard, imho.

turboponyy|2 years ago

If you're reinventing a language, it's probably not a bad idea to reinvent the simplest one!

therobots927|2 years ago

Just wondering, why order =, material, and carbon that way instead of material, =, carbon?

xd|2 years ago

It's "prefix" notation .. if you search something like "prefix vs infix vs postfix programming languages" it should return a decent explanation. For my case it's personal choice more than anything.. also easier for me to write a VM for.