Use mongo csharp driver with View

Viewed 219

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!

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)
Related