Table of Contents

Class FieldsBuilder

Namespace
MongoDB.Driver.Builders
Assembly
MongoDB.Driver.Legacy.dll

A builder for specifying which fields of a document the server should return.

[Serializable]
[BsonSerializer(typeof(FieldsBuilder.Serializer))]
public class FieldsBuilder : BuilderBase, IConvertibleToBsonDocument, IMongoFields
Inheritance
FieldsBuilder
Implements
Inherited Members
Extension Methods

Constructors

FieldsBuilder()

Initializes a new instance of the FieldsBuilder class.

Methods

ElemMatch(string, IMongoQuery)

Returns the first matching element in the array specified by name.

Exclude(params string[])

Adds one or more field names to be excluded from the results.

Include(params string[])

Adds one or more field names to be included in the results.

MetaTextScore(string)

Specifies the name of field to hold the computed relevance score for text search.

Slice(string, int)

Adds a slice to be included in the results.

Slice(string, int, int)

Adds a slice to be included in the results.

ToBsonDocument()

Returns the result of the builder as a BsonDocument.