英文:
Mongodb inserts one more document if I edit particular field such as flag like "email sent" ? corresponding JAVA POJO class has issue?
问题
MongoDB如果我编辑特定字段,例如"email sent"标志,会插入一个额外的文档吗?可能的问题是什么?对应的JAVA POJO类是否有问题?
英文:
Mongodb inserts one more document if I edit particular field such as flag like "email sent" ? what can be the issue ? corresponding JAVA POJO class has issue?
答案1
得分: -1
是的,POJO原本没有将@Id标记的ID作为JAVA类中的一项。在使用@Id注释添加ID属性后,同一文档被修改,而不是在集合中添加新文档。
英文:
Yes, POJO was not having @Id marked ID as one of the item in JAVA class. After Adding ID property with @Id annotation, same document was getting modified instead of adding new document in collection.
专注分享java语言的经验与见解,让所有开发者获益!
评论