Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Use mongo csharp driver with View

I have a view named test1 that contain a customized and advanced query.

Is it possibly to use mongo csharp driver in order retrieve the data from the view named test1 to the c# application?

Info:
*I'm new in MongoDB and mongo csharp driver.

Thank you!

like image 964
What'sUP Avatar asked Jan 19 '26 02:01

What'sUP


1 Answers

For retrieving data from a view, you can use the same code as to retrieve data from the collection:

var view = client
      .GetDatabase(databaseName)
      .GetCollection<TEntity>(viewName)
like image 177
dododo Avatar answered Jan 20 '26 18:01

dododo



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!