-
Type:
Task
-
Resolution: Gone away
-
Priority:
Minor - P4
-
None
-
Affects Version/s: None
-
Component/s: Query Operations
-
None
-
Environment:CentOS
-
None
-
None
-
None
-
None
-
None
-
None
-
None
I met a strange phenomenon, hope someone can provide a little clue to answer.
I added a compound index to mycollection. After using db.mycollection.find().Explain() in the shell, I can see that the index appears in WiningPlan, that is, the index is used. Checking by db.mycollection.aggregate ([{$ indexStats: {}}]) after find(), I can see that the index access counter has increased. Using python with pymongo also has the same result. Only java with MongoDB Java Driver (http://mongodb.github.io/mongo-java-driver/) can not make the access counter increase. It can not be determined that java uses that index. What can I do to ensure java use the index?