Table of Contents

Method Take

Namespace
MongoDB.Driver.Linq
Assembly
MongoDB.Driver.dll

Take<TSource>(IMongoQueryable<TSource>, int)

Returns a specified number of contiguous elements from the start of a sequence.

public static IMongoQueryable<TSource> Take<TSource>(this IMongoQueryable<TSource> source, int count)

Parameters

source IMongoQueryable<TSource>

The sequence to return elements from.

count int

The number of elements to return.

Returns

IMongoQueryable<TSource>

An IMongoQueryable<T> that contains the specified number of elements from the start of source.

Type Parameters

TSource

The type of the elements of source.

Take<TSource>(IMongoQueryable<TSource>, long)

Returns a specified number of contiguous elements from the start of a sequence.

public static IMongoQueryable<TSource> Take<TSource>(this IMongoQueryable<TSource> source, long count)

Parameters

source IMongoQueryable<TSource>

The sequence to return elements from.

count long

The number of elements to return.

Returns

IMongoQueryable<TSource>

An IMongoQueryable<T> that contains the specified number of elements from the start of source.

Type Parameters

TSource

The type of the elements of source.