zs2020
zs2020

Reputation: 54543

Make a query using C# Mongo driver without creating Query object?

According to the documentation, the MongoDB can be queried by creating Query object using the MongoDB driver for .Net, is there any alternative to query the MongoDB using the MongoDB query string?

I want to generate the MongoDB query string in JavaScript and pass it down to the MongoDB driver without creating a Query objects.

Thanks!

Upvotes: 2

Views: 308

Answers (1)

mrówa
mrówa

Reputation: 5781

Use Eval(), e.g.: database.Eval("return 1;");.

Upvotes: 1

Related Questions