Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
次の SQL クエリを Mongo 用に変換するにはどうすればよいでしょうか。
SELECT KeyID, SUM(Qty) FROM Table WHERE Date <= '1998-12-01'
何かのようなもの:
db.myTable.aggregate([ { $match: { mydate: { $lte: new Date('12/01/1998') } } }, { $group: { _id: "$keyid", totalqty: { $sum: "$qty" } }} ])