Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- db.feeds.aggregate(
- { $group: {
- // Group by fields to match on (a,b)
- _id: { link: "$link" },
- // Count number of matching docs for the group
- count: { $sum: 1 },
- // Save the _id for matching docs
- docs: { $push: "$_id"}
- }},
- // Limit results to duplicates (more than 1 match)
- { $match: {
- count: { $gt : 1 }
- }}
- )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement