I have a MongoDB collection "Posts" with data like this:
{
"_id": UUID('5fd671be-df7c-4dd2-87dc-9877a7fb1953'),
"EditorId": UUID('f79fc0d8-0200-4eef-91c2-4062ee9a2354'),
"Name": "Name 01"
}
In C# I tried to get all the record for a specific EditorId, I tried this:
BsonDefaults.GuidRepresentation = GuidRepresentation.Standard;
var postsCollection = _database.GetCollection<BsonDocument>("Posts");
var postsCollection2 = _database.GetCollection<Post>("Posts");
Guid editorId = ...
var postsDocs = postsCollection.Find(Builders<BsonDocument>.Filter.Eq("EditorId", editorObj.Id)).ToList();
var posts = postsCollection2.Find(p => p.EditorId == editorObj.Id).ToList();
But none of this way work, I got no result! Do you have any idea about the problem and how to solve this?
Thx