Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
当我尝试用 '.' 保存字典时 在键中 PyMongo 会引发错误(InvaildName),但是我确实看到(在 Mongodb 网站上)键可以包含“。”。为什么 pymongo 不让我保存这些文档?他们和Mongo有问题吗?
詹姆士
您在哪里看到带有“。”的文档示例 在一个关键的名字?这些在 MongoDB 中是无效的(因此 PyMongo 的限制)。
原因是我们在查询中使用点符号来到达嵌入文档的内部。
您可以在更新和查找中使用点,但不能在保存/插入中使用。