hey all =]
I’m working with python and trying to insert a dict into one of my fields but I get an error message when trying to do so…
I was able to insert the same data via the mongo shell, so It’s probably not a server issue.
In general, it is not recommended to use dot (.) within a field name for MongoDB document (see Dot Notation - Document Field Access). Though it is permissible in some cases (like in mongo shell), PyMongo is not allowing it (as per your own try and the resulting error). There is a related JIRA issue to learn something about it: PyMongo - dots allowed in field names when updating.
This is indeed the expected behaviour. Dots in field names is a bad practice and should be avoided.
Until support is added in the query language, the use of $ and . in field names is not recommended and is not supported by the official MongoDB drivers.