-
Type:
Question
-
Resolution: Done
-
Priority:
Major - P3
-
None
-
Affects Version/s: 2.6.8
-
Component/s: Querying
-
None
-
None
-
3
-
None
-
None
-
None
-
None
-
None
-
None
I have 40050 document within a collection. The document has about 48 attributes and with size being 935 (used Object.bsonsize(..) to identify the size).
When I try to run,
db.collection.find(
).sort(
{attribute1:1}).limit(50).skip(40000)
it results in
error:
at src/mongo/shell/query.js:131
I understand that creating an index on "attribute1" would fix this problem. In my application however, we enable sorting on all the 48 attributes the document has. Also, the number of documents satisfying the criteria could run into few hundred thousands. I want to understand if you still suggest creating index on all the 48 attributes? Or is there a better approach?
Would appreciate your help.