Details
-
Question
-
Resolution: Works as Designed
-
Trivial - P5
-
None
-
None
-
None
-
None
Description
Summary
Find Method on collection object is not working. Saying 'MongoDB.Driver.MongoCollectionBase<MongoDB.Bson.BsonDocument>' does not contain a definition for 'Find'
Please provide the version of the driver. If applicable, please provide the MongoDB server version and topology (standalone, replica set, or sharded cluster).
Driver version ---> 2.19.1
we are using Azure Cosmos DB for MongoDB account(RU) and server version 4.2
How to Reproduce
1. create Azure cosmost DB for MongoDB account(RU). version should be 4.2
2. create a sample db and collection name.
3. do write the following similar code,
__
using MongoDB.Driver;
using MongoDB.Bson;
var client = new MongoClient(connectionString);
var database = client.GetDatabase("teacher_profile");
var collection = database.GetCollection<BsonDocument>("chapters");
var filter = Builders<BsonDocument>.Filter.Eq("_id", ObjectId.Parse("64439214f877fcad42b31c38"));
var result = collection.Find(filter).FirstOrDefault();
Console.WriteLine(result);
Additional Background
Please provide any additional background information that may be helpful in diagnosing the bug.