adamlouis
I didn't intentionally model the Mongo query language. Some requirements were:
- JSON-based: so I did not have to parse the query
- Easy to extend: so I could add new operators later
- DB independent: so I could swap out SQLite with postgres, mongo, cockroach, duckdb, etc. IF I ever wanted to
- Expressive: so I could do aggregations / group-bys / etc
I considered using more popular standards like the ElasticSearch API but they weren't quite what I wanted. I liked how jsonlogic was basically just an AST. Its primitive structure makes code generation to other DB query languages straightforward.
I started this project with my own "JSON lisp" variant, but then found jsonlogic & used that since mine was _pretty_ close (only lists, no objects).
The top-level fields of my queries look like SQL (select, where, group_by, order_by) - I really like the Honeycomb query UI (https://www.honeycomb.io/query/) - so wanted to be able to support user experiences like that ... but also go further via arbitrary jsonlogic expressions.
This is something I had been thinking about - when dealing w/ normalized JSON documents, how might I allow exploration of referenced documents? & how might I encode those relationships is some way that's lightweight?
Thanks for sharing.
Yeah, jsonlogic does not seem THAT popular. A JSON-based solution that looks like an AST means you can skip query parsing & just do generation. I started this project with my own JSON Lisp DSL before going with jsonlogic.
In either case, I like the idea of being able to swap out arbitrary storage layers - sqlite, postgres, mongo, etc. - while keeping the JSON api.
Had not encountered odata - thanks for sharing!
By implementing the the ES API you may then be able to re-use parts of Kibana, Elastalert & other parts of the ES ecosystem ... could be cool!
Thanks for sharing those - will check them out. Interested to see what happens as the size of the dataset grows.
I have not looked deeply, but Typesense[1] seems like another interesting project. Similar to ES or Algolia, easy to self-host, & with a seemingly efficient memory & disk footprint.
Will take a cleanup pass soon - was excited just to ship it.
- save all plays
- save all “Discovery Weekly” playlists
- save top songs & artists of the last month, 6 months, and all-time & observe how each changes over time
This weekend, I wrote an article with some technical descriptions & learnings. Sharing my work here!
Thanks!
app link: https://spotify.suczewski.com
Show HN: Track Spotify plays, trends and discover weekly (article and app)
`returnif` is fun, but there's certainly value in the simplicity of restricted, opinionated syntax (e.g Go).
Was mostly a fun project to prove out & build a new idea. No plan ahead for this, but always new projects in the pipeline!