0
私が持っているすべての会議のDB全体の値を更新しようとしています。現在、それは次のようになります。MongoCollection update値が何かと等しい
{
"Referent" : null
"Participants" : [
{
"Email" : "[email protected]",
"Present" : true
},
{
"Email" : "[email protected]",
"Present" : false
},
{
"Email" : "[email protected]",
"Present" : true
}
]
}
私はこれが起こるしたい:明らか
if(meeting.Referent == null) {
foreach(var participant in meeting.Partipants) {
if(participant.Present) {
meeting.Referent = participant.Email;
}
}
}
上記のコードはするMongoCollectionのために動作しませんが、私はそれが理にかなって願っています。会議に出席しているランダムな(最初または最後の)参加者に会議の指示対象を設定したいと思います。
MongoCollectionを使ってどのようにしてMongo Shellで実行できますか?