3 ms·
This sounds interesting. Could you provide a link to the MongoDB aggregations that your are referring to because they're not something I'm familiar with? (Disc
by snthpy 3y ago
This sounds interesting. Could you provide a link to the MongoDB aggregations that your are referring to because they're not something I'm familiar with?
(Disclaimer: I'm a PRQL contributor.)
- zX41ZdbW 3y agoHere are examples of MongoDB aggregations: https://github.com/ClickHouse/ClickBench/blob/main/mongodb/queries.js https://github.com/ClickHouse/ClickBench/blob/main/mongodb/q... They are painful to write compared to SQL queries. Although the commercial version of MongoDB has support for SQL, it's not available for general MongoDB users.
- snthpy 3y agoThanks! Those do look awful and more what I remember from the brief period when I used MongoDB in around 2013 or so. I take it GP comment was just trolling then?
- breischl 3y agoI was not trolling, I actually dislike MongoDB aggregation syntax and it seems like PRQL is something that could potentially replace it or go on top. Admittedly I only took a quick glance at PRQL though, so perhaps I misunderstood something or it's not applicable to this case. There are examples on Mongo's page, eg https://www.mongodb.com/docs/manual/core/aggregation-pipeline/ https://www.mongodb.com/docs/manual/core/aggregation-pipelin... eg: db.orders.aggregate( [ // Stage 1: Filter pizza order documents by pizza size { $match: { size: "medium" } }, // Stage 2: Group remaining documents by pizza name and calculate total quantity { $group: { _id: "$name", totalQuantity: { $sum: "$quantity" } } } ] )