I have developed a software that permit users to filter data that is in a MongoDb database.
For exemple, they may want to extract Indicators that are from 7 days ago, with a score above 5 and a status that is active. This data is then send to another system to be used and digested.
Basically : extract this data from database and put it in this endpoint. The endpoint I mention is ingesting JSON.
To do so, I invented a filtering system based on a YAML syntax :
conditions:
- attribute: score
operator: gte
value: 3
- attribute: status
operator: is
value: Active
- attribute: created_at
operator: lt
value: 168
is_date: true
It works, no problem with that. Problem is that any change in the future may lead to a change on the software.
My question is how to provide a filtering system directly linked to the database I use ? Knowing that I use a DAO because database could be a MySQL or a MongoDB.
Let them directly type MongoDB queries (or MYSQL) ? Hum, risky. Move to GraphQL ? I am afraid it is a bit too late.