出现这个错误:MongoServerError: E11000 duplicate key error collection: schoolRun.order_receive index: openid_1 dup key
说明存在unique索引限制,重复的数据插入就会报上面的错误。
采用如下方法删除唯一性unique索引
db.getCollection("order_receive").dropIndexes(),其中dropIndexes()为删除所有索引
出现MongoServerError:E11000错误,表明在集合'schoolRun.order_receive'中存在唯一索引冲突。要消除此问题,可以使用`db.getCollection('order_receive').dropIndexes()`命令来删除所有索引,从而允许重复数据插入。
出现这个错误:MongoServerError: E11000 duplicate key error collection: schoolRun.order_receive index: openid_1 dup key
说明存在unique索引限制,重复的数据插入就会报上面的错误。
采用如下方法删除唯一性unique索引
db.getCollection("order_receive").dropIndexes(),其中dropIndexes()为删除所有索引

被折叠的 条评论
为什么被折叠?