A lot of people recoil at the idea of using SQLite, because SQL. Or, especially at the idea of just storing JSON in JSON fields and using SQL as something like a document store- but there has actually been a heap of work recently on SQLite for this exact usecase, and making it way nicer and more reliable to use than most document stores
JSON functions and operators:
https://www.sqlite.org/json1.html
recent json function enhancements
https://sqlite.org/src/doc/json-in-core/doc/json-enhancements.md
json virtual columns
https://antonz.org/json-virtual-columns/