Reputation: 65278
I will have hundreds of fields in a document. If I only need one or two fields in a given document - does MongoDB transfer the whole document across the wire?
Upvotes: 0
Views: 71
Reputation: 312035
Projection is handled server-side, so only the fields that are included in the query's projection will be transferred over the wire.
In the C# driver, this is accomplished via the SetFields method on MongoCursor.
SetFields
MongoCursor
Upvotes: 1