I need to query MongoDB with a standard query as follows:
{"$and":[{"Name":"Accelero JKT M Tun XL "}]}
I usually build queries using a Query object in C #, and then do something like this:
MongoCollection<BsonDocument> col = _database.GetCollection<BsonDocument>("SourceItem");
var query = Query.And(Query.EQ("AccountID", BsonValue.Create(Convert.ToInt32(_accountID))), Query.EQ("SKU", sku));
var docs = col.Find(query);
Since I already have a query, I donβt want to use the Query object to build the query. How easy is it to use a query that I already have?
source
share