1

我想将我的数据从“demographic.education”列移动到“demographic.school”。我怎么能这样做?

例如:

db.users.update({"demographic.education":{$exists: true, $ne: ""}}, {$set: {"demographic.school":demographic.education}})
4

1 回答 1

2

您可以$rename为此使用修饰符:

db.users.update({"demographic.education": {$exists: true, $ne: ""}}, {$rename: {"demographic.education": "demographic.school"}})

文档

于 2012-12-19T22:59:11.953 回答