4
C#とmongoDBを使用して埋め込みフィールドの名前を変更するにはどうすればよいですか?文書の例人は、次のようになります。MongoDBの構文でmongoDB埋め込みフィールドの名前を変更
{
Id: 1,
LastName: "Smith",
FirstName: "John",
Orders: {
Id: 1,
Name: "Trousers" // I want to rename **Name** into **Something**
}
}
、それは
db.Users.update({}, {$rename:{"Orders.Name":"Orders.Something"}},true, true)
おかげようなものになるだろう。
MongoDB.Driver.Builders.Update.Rename(string oldElementName,
string newElementName)
それはあなたがcollection.Update()に渡すと、あなたのフィールドの名前を変更することができIUpdateQueryを、返しで
は