0
重新創建的索引
我跑db.users.getIndexes()
和複製的輸出:在蒙戈
{
"v" : 1,
"unique" : true,
"key" : {
"local.email" : 1
},
"name" : "local.email_1",
"ns" : "howl.users",
"background" : true,
"safe" : null
}
我在"sparse": true"
加入,並試圖重新創建索引與該命令(滴加之後):
db.users.createIndex({ "v" : 1, "unique" : true, "sparse" : true, "key" : { "local.email" : 1 },"name" : "local.email_1", "ns" : "howl.users","background" : true, "safe" : null });
它失敗並顯示此消息:
「errmsg」:「異常:錯誤的索引鍵模式{v:1.0,unique:true, sparse:true,key:{local.email:1.0},name:\「local.email_1 \」,ns: \「howl.users \」,background:true,safe:null}:未知索引插件 ' local.email_1'「
我在做什麼錯在這裏?
你更新datatbase?這可能聽起來像一個愚蠢的問題,只是想在我發佈解決方案之前確定。 – John