我正在尝试使用 MongoDB shell 删除文档,但由于某种原因,它一直在“无效的对象 id:长度”上失败
查询:
db.collections.remove( { _id : ObjectId("FF125DF6-E977-404A-9E8C-600CDAFEFF53" )} );
错误:
12 月 24 日星期一 03:11:15 断言:10448:无效的对象 ID:length 0x6073f1 0x5d1aa9 0x5ac3f1 0x5b84f4 0x6aa5ac 0x6aaec8 0x69e4e7 0x6aa13f 0x668e46 0x668ec2 0x66a2ce 0x5cbcc4 0x4a44a6 0x4a67e6 0x7f2554e2fcdd 0x49f669 mongo(_ZN5mongo15printStackTraceERSo+0x21) [0x6073f1] mongo(_ZN5mongo11msgassertedEiPKc+0x99) [0x5d1aa9] mongo() [0x5ac3f1] mongo(_ZN5mongo21object_id_constructorEP9JSContextP8JSObjectjPlS4_+0x2b4) [0x5b84f4] mongo(js_Invoke+0x40c) [0x6aa5ac] mongo(js_InvokeConstructor+0x108) [0x6aaec8] mongo(js_Interpret+0x37c7) [0x69e4e7] mongo(js_Execute+0x36f) [0x6aa13f] mongo(JS_EvaluateUCScriptForPrincipals+0x66) [0x_Evaluate]UCScript+0x66) [0xEvaluate]88 ) [0x668ec2] mongo(JS_EvaluateScript+0x6e) [0x66a2ce] mongo(_ZN5mongo7SMScope4execERKNS_10StringDataERKSsbbbi+0x144) [0x5cbcc4] mongo(_Z5_mainiPPc+0x2156) [0x4a44a6] mongo(main+0x26) [/libc.6]/lib6(__libc_start_main+0xfd)[0x7f2554e2fcdd] mongo(__gxx_personality_v0+0x2a1)[0x49f669] 12 月 24 日星期一 03:11:15 错误:无效的对象 id:长度(shell):1
我试着跑步
db.repairDatabase();
但没有任何改变。通过检查我发现这是一个已知问题,是否有解决方法?
编辑
这是数据库中的文档:
{
"_id": "FF125DF6-E977-404A-9E8C-600CDAFEFF53",
“数据”: {
"files": [ ], "categories": [ ], "trash": [ ] }
}
谢谢!