MongoDb Aggregate , find duplicate records within 7 days
问题 I have to create a check for this use case- Duplicate payment check • Same amount to a same account number in last 7 days for all transactions. I haven't used mongoDb as much would have been easier for me to write in sql This is what I am trying without the 7 days part db.transactiondetails.aggregate({$group: {"_id":{"account_number":"$account_number","amount":"$amount"},"count": { $sum: 1 }}}) Where I get something like this : { "_id" : { "account_number" : "xxxxxxxy", "amount" : 19760 },