Table of Contents

Class Fields

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

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

public static class Fields
Inheritance
Fields
Inherited Members

Properties

Null

Gets a null value with a type of IMongoFields.

public static IMongoFields Null { get; }

Property Value

IMongoFields

Methods

ElemMatch(string, IMongoQuery)

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

public static FieldsBuilder ElemMatch(string name, IMongoQuery query)

Parameters

name string

The name.

query IMongoQuery

The query.

Returns

FieldsBuilder

The build (so method calls can be chained).

Exclude(params string[])

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

public static FieldsBuilder Exclude(params string[] names)

Parameters

names string[]

One or more field names.

Returns

FieldsBuilder

The builder (so method calls can be chained).

Include(params string[])

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

public static FieldsBuilder Include(params string[] names)

Parameters

names string[]

One or more field names.

Returns

FieldsBuilder

The builder (so method calls can be chained).

MetaTextScore(string)

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

public static FieldsBuilder MetaTextScore(string name)

Parameters

name string

The name of the field to hold the computed relevance score.

Returns

FieldsBuilder

The builder (so method calls can be chained).

Slice(string, int)

Adds a slice to be included in the results.

public static FieldsBuilder Slice(string name, int size)

Parameters

name string

The name of the field to slice.

size int

The size of the slice (negative sizes are taken from the end).

Returns

FieldsBuilder

The builder (so method calls can be chained).

Slice(string, int, int)

Adds a slice to be included in the results.

public static FieldsBuilder Slice(string name, int skip, int limit)

Parameters

name string

The name of the field to slice.

skip int

The number of values to skip.

limit int

The number of values to extract.

Returns

FieldsBuilder

The builder (so method calls can be chained).