Details
-
Task
-
Resolution: Done
-
Major - P3
-
None
-
None
Description
I have got 2 documents in a collection. Second document is updated once and so has got different representation of Platforms (with type and value). It gets serialized into C# object properly but when I search inside Platforms array using platform id, I get only one record back which is first document. I am using following C# code for the search:
var filter = Builders<Application>.Filter.Eq("Platforms.Id", platform.Id);
|
var documents = await _collection.Find(filter).ToListAsync();
|
Document:
{
|
"_id" : ObjectId("5666aa08e592a021485b18b0"),
|
"Name" : "App1",
|
"Platforms" : [{
|
"_id" : "5665a0cde592942148a9ac2f",
|
"Name" : "Windows"
|
}, {
|
"_id" : "5665a0d3e592942148a9ac30",
|
"Name" : "iOS"
|
}]
|
}
|
|
|
{
|
"_id" : ObjectId("5666aa19e592a021485b18b1"),
|
"Name" : "App2",
|
"Platforms" : {
|
"_t" : "System.Collections.Generic.List`1[[MyPortal.Model.DTO.Lookup, MyPortal.Model]]",
|
"_v" : [{
|
"_id" : "5665a0d3e592942148a9ac30",
|
"Name" : "iOS"
|
}, {
|
"_id" : "5665a0cde592942148a9ac2f",
|
"Name" : "Windows x"
|
}]
|
}
|
}
|