Why is that aggregation pipeline queries are so complicated?

why are these queries so complicated? This question is more for the creator of this language. I think its unnecessarily complicated or maybe I need more time to get used to it… :grinning:

for example below is very simple query:

BELOW:
[
{
‘$match’: {
‘imdb.rating’: { ‘$gte’: 7 },
‘genres’: {’$nin’: [ ‘Crime’, ‘Horror’ ]},
‘rated’: { ‘$in’: [‘PG’, ‘G’]},
‘$and’: [{‘languages’: {’$eq’: ‘English’}}, {‘languages’: ‘$eq’: ‘Japanese’} } ]
}
},
{
‘$project’: {’_id’: 0, ‘title’: 1, ‘rated’: 1}
}
]

COULD HAVE BEEN DONE LIKE THIS…IT IS SO SIMPLE, EASY TO UNDERSTAND AND HUMAN REDABLE…

[
{
‘$match’: {
‘imdb.rating’ > 7 },
‘genres’ $nin [ ‘Crime’, ‘Horror’ ],
‘rated’ $in [‘PG’, ‘G’],
{‘languages’ == ‘English’} $and {‘languages’ == ‘Japanese’}
}
},
{
‘$project’: {’‘title’, ‘rated’}
}
]

Everything is JSON. So the query language has been created to fit JSON syntax. JSON was chosen because the web has adopted JSON. Once you know JSON you know the syntax of queries and aggregations.

yea that makes sense…thx!