Table of Contents

Method Slice

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

Slice<TValue>(Expression<Func<TDocument, IEnumerable<TValue>>>, int)

Adds a slice to be included in the results.

public static FieldsBuilder<TDocument> Slice<TValue>(Expression<Func<TDocument, IEnumerable<TValue>>> memberExpression, int size)

Parameters

memberExpression Expression<Func<TDocument, IEnumerable<TValue>>>

The member expression.

size int

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

Returns

FieldsBuilder<TDocument>

The builder (so method calls can be chained).

Type Parameters

TValue

The type of the enumerable member values.

Slice<TValue>(Expression<Func<TDocument, IEnumerable<TValue>>>, int, int)

Adds a slice to be included in the results.

public static FieldsBuilder<TDocument> Slice<TValue>(Expression<Func<TDocument, IEnumerable<TValue>>> memberExpression, int skip, int limit)

Parameters

memberExpression Expression<Func<TDocument, IEnumerable<TValue>>>

The member expression.

skip int

The number of values to skip.

limit int

The number of values to extract.

Returns

FieldsBuilder<TDocument>

The builder (so method calls can be chained).

Type Parameters

TValue

The type of the enumerable member values.