views:

116

answers:

2

When I try saving a dict with a '.' in the key PyMongo throws an error (InvaildName) however I do see (on the Mongodb website) that keys can have '.''s in them. Why is it that pymongo won't let me save these docs? Is there an issue with them and Mongo?

James

+4  A: 

Where are you seeing an example of documents with "." in a key name? Those are invalid in MongoDB (hence PyMongo's restriction).

The reasoning is that we use dot notation in queries to reach inside of embedded documents.

mdirolf
A: 

You can use the dot in updates and finds, but not in save/insert.

eckberg