Recently i was playing with mongodb official driver. The problem that i've encountered was how to make query projection. Example if i have a persisted object
class A{
id
PropA
PropB
List<LargeObjects>
}
How can i only retrieve id, PropA and PropB instead of retrieving the whole object ? How can be done with the mongodb official c# driver ?
Query projection is available through:
MongoCollection<>.Find().SetFields(include/exclude);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With