mongoengine icon indicating copy to clipboard operation
mongoengine copied to clipboard

No way to rename a column

Open anandsainath opened this issue 11 years ago • 0 comments

There doesn't seem to be a way to rename a column in a document. I would like to do an operation similar to the below MongoDB Query using a MongoEngine Query

db.list_input_file.update({},{$rename:{"content.Confe- rence" : "Conference"}}, false, true);

The only way to do this now is via the raw query.

JListInputFile.objects.update(__raw__={"$rename": {"content.old_name": "content.new_name"}})

anandsainath avatar Oct 03 '14 15:10 anandsainath