在MongoDB中执行以下查询
db.getCollection("translations").find({namespace: "public_frontend"})
会导致以下错误
Query failed with error code 291 and error message 'error processing query: ns=i18n_api.translations batchSize=21Tree: namespace $eq "public_frontend" Sort: {} Proj: {} planner returned error :: caused by :: No indexed plans available, and running with 'notablescan'' on server
该集合具有以下索引:
[
{
"v" : 2.0,
"key" : {
"_id" : 1.0
},
"name" : "_id_"
},
{
"v" : 2.0,
"key" : {
"key" : 1.0,
"namespace" : 1.0
},
"name" : "key_1_namespace_1",
"unique" : true,
"sparse" : true
}
]
1条答案
按热度按时间bogh5gae1#
这可能是因为您尚未在mongoDB中创建索引