【发布时间】:2020-10-07 08:38:08
【问题描述】:
我收集了以下文件,例如:
{
"_id" : ObjectId("2819738917238dgd21873"),
"mailIntid" : 10000000,
"mailCreated" : "2019-02-08",
"mailLastModified" : null,
"mailReceived" : "2019-02-08",
"mailSend" : "2019-02-08",
"hadAttachment" : false,
"subject" : "nieuwe vacature ",
"bodyPreview" : "Test Body",
"importance" : "normal",
"isDeliveryRequested" : null,
"isReadReceiptRequested" : false,
"isRead" : false,
"isDraft" : false,
"inferenceClassification" : "focused",
"bodyContentType" : "html",
"senderName" : "Jobs",
"senderEmail" : "noreply@test.nl",
"fromName" : "Jobs",
"fromEmail" : "noreply@mailing.test.nl",
"flagStatus" : "notFlagged",
"urls" : "https://test.nl/request-details?id=1337",
"insertDate" : "2019-02-09",
"modifiedDate" : "2019-05-05",
"parseComplete" : true,
"rawMailUrl" : [
{
"url" : "https://test.nl/request-details?id=1337",
"parsed" : false
}
]
}
我使用以下代码创建了一个索引:
db.testAB.createIndex(
{"rawMailUrl.parsed": 1},
{partialFilterExpression: { "rawMailUrl.parsed": false}}
)
但是每当我使用以下查询时,它都没有使用上面的索引。
db.testAB.find({"rawMailUrl.parsed": false})
有什么想法吗?我用数组和真假表达式创建索引时做错了吗?
【问题讨论】: