我有以下数据表:
{
"_id" : ObjectId("value"),
"owner" : "testuser",
"date" : ISODate("2017-03-16T12:45:03.386Z"),
"location" : "thuis",
"venue" : "bijna thuis",
"description" : "fghgfh",
"completed" : false,
"winnerName" : null,
"subscriptions" : [],
"interactions" : [
{
"_id" : ObjectId("objectid"),
"owner" : "testuser",
"type" : "guess",
"date" : ISODate("2017-03-06T12:13:10.049Z"),
"answer" : false,
"message" : "test 1"
},
{
"_id" : ObjectId("objectid"),
"owner" : "testuser",
"type" : "guess",
"date" : ISODate("2017-03-06T12:13:10.049Z"),
"answer" : false,
"message" : "test 2"
}
],
"__v" : 0,
"active" : true
}
以上只是一个游戏对象。这意味着我们的数据库中有几个这样的对象。
我试图仅获得所有者==“testuser”的交互。
问题是我似乎无法找出最好的方法来做到这一点。
在我的代码中,我得到了 2 个对象(游戏和交互),其中游戏有一系列交互。
有什么办法我仍然可以使用 mongocsharpdriver 来做到这一点吗?
预先感谢您的所有帮助。