How to fetch specific data from the collection using mongo query using asp.net core.
var Client = new MongoClient(connectionString);
var dbName = Client.GetDatabase(databaseName);
var collection = dbName.GetCollection<BsonDocument>(collectionName);
var res = collection.Find({},{_id:0,name:1}).ToList();
The error is:
String contains extra non-whitespace characters beyond the end of the document.