Table of Contents

Method Slice

Namespace
MongoDB.Driver
Assembly
MongoDB.Driver.dll

Slice<TDocument>(ProjectionDefinition<TDocument>, FieldDefinition<TDocument>, int)

Combines an existing projection with an array slice projection.

public static ProjectionDefinition<TDocument> Slice<TDocument>(this ProjectionDefinition<TDocument> projection, FieldDefinition<TDocument> field, int limit)

Parameters

projection ProjectionDefinition<TDocument>

The projection.

field FieldDefinition<TDocument>

The field.

limit int

The limit.

Returns

ProjectionDefinition<TDocument>

A combined projection.

Type Parameters

TDocument

The type of the document.

Slice<TDocument>(ProjectionDefinition<TDocument>, FieldDefinition<TDocument>, int, int)

Combines an existing projection with an array slice projection.

public static ProjectionDefinition<TDocument> Slice<TDocument>(this ProjectionDefinition<TDocument> projection, FieldDefinition<TDocument> field, int skip, int limit)

Parameters

projection ProjectionDefinition<TDocument>

The projection.

field FieldDefinition<TDocument>

The field.

skip int

The skip.

limit int

The limit.

Returns

ProjectionDefinition<TDocument>

A combined projection.

Type Parameters

TDocument

The type of the document.

Slice<TDocument>(ProjectionDefinition<TDocument>, Expression<Func<TDocument, object>>, int)

Combines an existing projection with an array slice projection.

public static ProjectionDefinition<TDocument> Slice<TDocument>(this ProjectionDefinition<TDocument> projection, Expression<Func<TDocument, object>> field, int limit)

Parameters

projection ProjectionDefinition<TDocument>

The projection.

field Expression<Func<TDocument, object>>

The field.

limit int

The limit.

Returns

ProjectionDefinition<TDocument>

A combined projection.

Type Parameters

TDocument

The type of the document.

Slice<TDocument>(ProjectionDefinition<TDocument>, Expression<Func<TDocument, object>>, int, int)

Combines an existing projection with an array slice projection.

public static ProjectionDefinition<TDocument> Slice<TDocument>(this ProjectionDefinition<TDocument> projection, Expression<Func<TDocument, object>> field, int skip, int limit)

Parameters

projection ProjectionDefinition<TDocument>

The projection.

field Expression<Func<TDocument, object>>

The field.

skip int

The skip.

limit int

The limit.

Returns

ProjectionDefinition<TDocument>

A combined projection.

Type Parameters

TDocument

The type of the document.