MongoDB 写入错误“代码": 9 [英] MongoDB WriteError "code" : 9
本文介绍了MongoDB 写入错误“代码": 9的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我试图从 MongoDB 中删除一些具有脏值的记录,但是每当我尝试删除它时,我都会收到 writeError 和 代码 9.>
脏文件示例如下:
<代码>{"_id": "some_unique_id_abcd",tmp":1415772407377",艾滋病毒":0.0",生活":0.0",指数":0.0"}
执行的remove命令如下:
db.myCollection.remove({"_id" : "some_unique_id_abcd"});
抛出以下错误
WriteResult({写错误":{代码":9,"errmsg" : "'delete' 字段类型错误,需要的字符串,发现删除:0.0"}})
知道这个错误究竟是关于什么或如何解决它吗?
解决方案
这个是错误代码的意思:
error_code("FailedToParse", 9)
I am trying to delete some records from MongoDB that have dirty values, but whenever I try to delete it, I am getting the writeError with code 9.
A sample of the dirty document is as follows:
{
"_id" : "some_unique_id_abcd",
"tmp" : "1415772407377",
"hiv" : "0.0",
"liv" : "0.0",
"oindx" : "0.0"
}
The remove command executed is as follows:
db.myCollection.remove({"_id" : "some_unique_id_abcd"});
The following error is thrown
WriteResult({
"writeError" : {
"code" : 9,
"errmsg" : "wrong type for 'delete' field, expected string,
found delete: 0.0"
}
})
Any idea what exactly this error is about or how to get around it?
解决方案
This is what the error code means:
error_code("FailedToParse", 9)
这篇关于MongoDB 写入错误“代码": 9的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文