MongoEngine: Adding Fields to Dynamic Document
问题 I would like to store dynamic fields to the document, but each document can have different fields. for eg: Class SampleDoc(DynamicDocument): xyz = StringField() df = "field1" a = SampleDoc() a.df = "testing" a.save() If i run the above program, the mongodb document looks like the following. { "_id" : ObjectId("53905681e5ba5b3bfd1f5242"), "_cls" : "DataPoint", "df" : "testing" } but what i want is that the field name should be "field1" instead of "df" like this.. { "_id" : ObjectId(