diff options
author | Nick Zolnierz <nicholas.zolnierz@mongodb.com> | 2020-07-23 13:11:25 -0400 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-07-29 19:31:31 +0000 |
commit | 1dfde3f7a6ada7440c90301843e8b60335fb800c (patch) | |
tree | 148d0979e6081fd427366ff186db15c57e5058a5 /src/mongo/db/pipeline/document_source_skip.cpp | |
parent | 58283ca178782c4d1c4a4d2acd4313f6f6f86fd5 (diff) | |
download | mongo-1dfde3f7a6ada7440c90301843e8b60335fb800c.tar.gz |
SERVER-48848 Add support for $sample aggregation stage in grammar and CST
Diffstat (limited to 'src/mongo/db/pipeline/document_source_skip.cpp')
-rw-r--r-- | src/mongo/db/pipeline/document_source_skip.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/mongo/db/pipeline/document_source_skip.cpp b/src/mongo/db/pipeline/document_source_skip.cpp index f38036f0152..33fff89bcef 100644 --- a/src/mongo/db/pipeline/document_source_skip.cpp +++ b/src/mongo/db/pipeline/document_source_skip.cpp @@ -100,6 +100,7 @@ Pipeline::SourceContainer::iterator DocumentSourceSkip::doOptimizeAt( intrusive_ptr<DocumentSourceSkip> DocumentSourceSkip::create( const intrusive_ptr<ExpressionContext>& pExpCtx, long long nToSkip) { + uassert(15956, "Argument to $skip cannot be negative", nToSkip >= 0); intrusive_ptr<DocumentSourceSkip> skip(new DocumentSourceSkip(pExpCtx, nToSkip)); return skip; } @@ -110,7 +111,6 @@ intrusive_ptr<DocumentSource> DocumentSourceSkip::createFromBson( str::stream() << "Argument to $skip must be a number not a " << typeName(elem.type()), elem.isNumber()); auto nToSkip = elem.safeNumberLong(); - uassert(15956, "Argument to $skip cannot be negative", nToSkip >= 0); return DocumentSourceSkip::create(pExpCtx, nToSkip); } |