Jp_B
(Jp B)
1
on mysql,oracle,sybase, i got never problem with a just simple distinct
i need to check no duplicate uuid field before create index with unique id on very big dataset of 70 millions records
but if i use distinct(“uuid”) i got message exeeed limit of 16MB
i use aggregation with count on uuid and allowDisckUse: true, i got bson data to large error
is it impossible to do a distinct like other database sql ?
_
Try these and count the distinct values:
db.testColl.aggregate([
{$group: { _id: "$uuid" } },
]).itcount()
db.testColl.aggregate([
{ $group: { _id: "$uuid" } },
{ $count: "c" }
])
Jp_B
(Jp B)
3
it’s working, thanks
but i must add allowDiskUse:true
db[“mycollection”].aggregate([ {$group: { _id: “$uuid” } } ],{allowDiskUse:true}).itcount()