Hi @Takis,
Can you share an example of the sort of formatting you are looking for (sample document before & after)? Folks have different preferences for formatting of MQL and JSON queries.
I second @steevej’s suggestion of jq for pretty-printing JSON (and it is great for quick filtering and wrangling, too). For quick formatting I use pretty-printing in the mongo shell, or work in a more visual tool like MongoDB Compass.
I build more complicated aggregation queries using variables for readability and more straightforward debugging. @steevej shared a great example of this in a recent discussion:
Regards,
Stennie