Problems with queries in mongodb -
this question has answer here:
i starting use mongodb , have problem in consultation queries. following error happens.
db.user_tracking.distinct("q") sun may 19 20:02:01.785 javascript execution failed: distinct failed: { "errmsg" : "exception: distinct big, 16mb cap", "code" : 10044, "ok" : 0 } @ src/mongo/shell/collection.js:l879
can tell me how solve this? thanks.
well running 16mb document result in mongodb when call distinct() method collect array of distinct values given field. if such result bigger 16mb you'll error.
to avoid may want use aggregation framework can collect same output paginating result ex:
db.user_tracking.aggregate( {$limit: x}, {$skip: y}, {$group: {_id: "$q"} ) loop around x , y values , overcome 16mb limitation.
n.
Comments
Post a Comment