I have create two data models and try to apply different query on it using mongoDb C# driver. Here is the query in a get method
var res = _postCollection.Aggregate().Lookup("_commentCollection", "Comments", "_id", "result").ToList();
return OK(res)
But when I call the method from postman get the following result
System.InvalidCastException: Unable to cast object of type 'MongoDB.Bson.BsonObjectId' to type 'MongoDB.Bson.BsonBoolean'.
at get_AsBoolean(Object )
at System.Text.Json.JsonPropertyInfoNotNullable`4.OnWrite(WriteStackFrame& current, Utf8JsonWriter writer)
...............