I have 100 million records in my "sample" collection. I want to have another collection with all of the distinct user names "user.screen_name"
I have the following structure in my mongodb database "sample" collection:
{
"_id" : ObjectId("515af34297c2f607b822a54b"),
"text" : "random text goes here",
"user" :
{
"id" : 972863366,
"screen_name" : "xname",
"verified" : false,
"time_zone" : "Amsterdam",
}
}
When I try things like "distinct('user.id).length" I get the following error:
"errmsg" : "exception: distinct too big, 16mb cap",
I need an efficient way to have another collection with only {"user_name": "name"} of distinct users in my "sample" collection. so then I can query the size of this new database and get the number of distinct users. (and for further analysis in the future)