Class FieldsBuilder<TDocument>
A builder for specifying which fields of a document the server should return.
[Serializable]
[BsonSerializer(typeof(FieldsBuilder<>.Serializer))]
public class FieldsBuilder<TDocument> : BuilderBase, IConvertibleToBsonDocument, IMongoFields
Type Parameters
TDocument
The type of the document.
- Inheritance
-
FieldsBuilder<TDocument>
- Implements
- Inherited Members
- Extension Methods
Constructors
- FieldsBuilder()
Initializes a new instance of the FieldsBuilder class.
Methods
- ElemMatch<TValue>(Expression<Func<TDocument, IEnumerable<TValue>>>, Func<QueryBuilder<TValue>, IMongoQuery>)
Returns the first matching element in the array specified by name.
- Exclude(params Expression<Func<TDocument, object>>[])
Adds one or more field names to be excluded from the results.
- Include(params Expression<Func<TDocument, object>>[])
Adds one or more field names to be included in the results.
- MetaTextScore(Expression<Func<TDocument, object>>)
Specifies the name of field to hold the computed relevance score for text search.
- Slice<TValue>(Expression<Func<TDocument, IEnumerable<TValue>>>, int)
Adds a slice to be included in the results.
- Slice<TValue>(Expression<Func<TDocument, IEnumerable<TValue>>>, int, int)
Adds a slice to be included in the results.
- ToBsonDocument()
Converts this object to a BsonDocument.