MongoDB Query在创建索引后不返回完整数据

时间:2013-01-21 09:36:30

标签: mongodb indexing

我有一个包含以下数据的MongoDB Colllection

> db.UpdateQueryRegistry.find({"studyId" : "20130117193010cfab"})

{  "_id":ObjectId("50f95af799ac247d280484dc"),
   "attempts":0,
   "eTime": ISODate("2013-01-17T17:03:36.501Z"),
   "lastUpdDt": ISODate("2013-01-18T14:23:51.141Z"),
   "numQueries":1,
   "query":"Q1",
   "sTime":null,
   "start":0,
   "status":"COMPLETED",
   "studyId":"20130117193010cfab",
   "updateAction":"convertToIUorNO",
   "updateSource":"DOCUMENTSTATUS"
}
{ "_id":ObjectId("50f95af799ac247d280484db"),
   "attempts":0,
   "eTime": ISODate("2013-01-17T19:50:34.392Z"),
   "lastUpdDt": ISODate("2013-01-18T14:23:51.141Z"),
   "numQueries":1,
   "query":"Q2",
   "sTime":null,
   "start":0,
   "status":"COMPLETED",
   "studyId":"20130117193010cfab",
   "updateAction":"instanceAddQuery",
   "updateSource":"ONTOLOGY"
}
{ "_id":ObjectId("50f95af799ac247d280484da"),
   "studyId":"20130117193010cfab",
   "updateSource":"ONTOLOGY",
   "updateAction":"instanceDeleteQuery",
   "query":"Q3",
   "sTime":null,
   "eTime":null,
   "status":"PENDING",
   "numQueries":0,
   "lastUpdDt": ISODate("2013-01-18T14:23:51.141Z"),
   "attempts":0,
   "start":0
}

索引在DB上创建如下:

> db.UpdateQueryRegistry.stats().indexSizes

{
    "_id_" : 8176,
    "studyId_1_status_1" : 24528,
    "studyId_1_updateSource_1_updateAction_1_query_1" : 98112
}

但是当我解雇查询

db.UpdateQueryRegistry.find({
    "studyId" : "20130117193010cfab",
    "updateSource" : "ONTOLOGY",
    "updateAction" : "instanceDeleteQuery"
})

我没有得到任何结果,但是当我解除查询时

db.UpdateQueryRegistry.find({
    "studyId" : "20130117193010cfab"
})

我看到上面显示的3个结果。请告诉我这是否有任何错误。

0 个答案:

没有答案