ということで、適当なセカンダリで重複を探して予め削除する必要が。 aggregateで探す例)
1 aggregate([ 2 {:$group => {_id: {user_id:"$user_id", date:"$date"}, 3 uniqueIds:{:$addToSet => "$_id"}, count:{:$sum => 1}}}, 4 {:$match => {count: {:$gt => 1}}}], 5 allowDiskU se: true)
posted by
genki
on Fri 22 May 2015
at 02:28