I've this query:
string jsonquery = "{
$and : [{
WordsData : {
$elemMatch : {
UserId : ObjectId('57a87f5cc48933119cb96f93'),
UserId : ObjectId('57a87f5cc48933119cb96f94')
}
}
}, {
WordsData : {
$not : {
$elemMatch : {
MatchType : 2
}
}
}
}
]
}"
if i execute it in a mongo console works correctly!
I'm trying to run this query in a c# program. Running the same json query i got the following error:
BsonDocument doc = BsonSerializer.Deserialize<BsonDocument>(jsonquery);
[Error] --> {"Duplicate element name 'UserId'."}
Why doesn't works in c# ?