MongoError: The dotted field .. is not valid for storage

Mongodb3.6版本前,文档中有{key:value}结构,且key中包含了“.”,在写数据库的时候就会报这个错误,这是页因为MongoDB对字段名字做了限制,这个问题在3.6及以后版本被修复了。

在3.2.22版本上尝试,当插入带key中带"."时就会报错。

 在4.0.4版本上验证没有问题

 

参考:

https://stackoverflow.com/questions/30014243/mongoerror-the-dotted-field-is-not-valid-for-storage

原文地址:https://www.cnblogs.com/zcqkk/p/10718196.html