mongo更新查询给定错误 [英] mongo update query given error

查看:119
本文介绍了mongo更新查询给定错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Coll.update(condition, new BasicDBObject("$set", data), true, true))

这是我在mongodb中的更新查询,其中某些记录显示为

This is my update query in mongodb for some records it gives result as

{ "err" :  null  , "updatedExisting" : true , "n" : 1 , "ok" : 1.0}

并在那时正确执行存储的更新查询.

and at that time stored update query execute properly.

但是对于某些记录,结果为

but for some records it give result as

{ "err" : "not okForStorage" , "code" : 12527 , "n" : 0 , "ok" : 1.0}

既不记录更新也不存储在数据库中

records neither update nor stoare in db

数据中使用了多个BasicDBList(列表).

in data there are multiple BasicDBList (list) used.

如果有人知道请回复

谢谢

推荐答案

文档字段/键中很有可能存在无效字符.

More than likely there are invalid characters in your document fields/keys.

例如,字段名称中不能包含句点.或美元符号$.

For example, you can't have a period . or a dollar sign $ in your field names.

如果您发送以下内容的输出,我可以提供更多帮助.

If you send the output from the following, I can help more.

System.out.println(data);

这篇关于mongo更新查询给定错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆