Docs Menu

$skip (aggregation)

이 페이지의 내용

$skip

Skips over the specified number of 문서 that pass into the stage and passes the remaining documents to the next stage in the 파이프라인.

$skip 단계의 프로토타입 형식은 다음과 같습니다.

{ $skip: <positive 64-bit integer> }

$skip takes a positive integer that specifies the maximum number of documents to skip.

참고

MongoDB 5.0부터 $skip 파이프라인 집계에 64비트 정수 제한이 있습니다. 이 제한을 초과하여 파이프라인에 전달된 값은 잘못된 인수 오류를 반환합니다.

$skip 단계를 다음 중 하나와 함께 사용하는 경우:

$skip 단계로 결과를 전달하기 전에 정렬에 고유 값을 포함하는 필드를 하나 이상 포함해야 합니다.

Sorting on fields that contain duplicate values may return a different sort order for those duplicate fields over multiple executions, especially when the collection is actively receiving writes.

정렬 일관성을 보장하는 가장 쉬운 방법은 정렬 쿼리에 _id 필드를 포함하는 것입니다.

각각에 대한 자세한 내용은 다음을 참조하세요:

다음 예를 고려하십시오.

db.article.aggregate([
{ $skip : 5 }
]);

This operation skips the first 5 documents passed to it by the pipeline. $skip has no effect on the content of the documents it passes along the pipeline.

다음도 참조하세요.

이 페이지의 내용