Skip to content

Commit

Permalink
DATAMONGO-1521 - Added Aggregation.skip(…) overload to support longs.
Browse files Browse the repository at this point in the history
Deprecated the one taking an int.
  • Loading branch information
odrotbohm committed Nov 3, 2016
1 parent e974187 commit 4875f07
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
Expand Up @@ -245,11 +245,22 @@ public static SortOperation sort(Direction direction, String... fields) {
*
* @param elementsToSkip must not be less than zero.
* @return
* @deprecated prepare to get this one removed in favor of {@link #skip(long)}.
*/
public static SkipOperation skip(int elementsToSkip) {
return new SkipOperation(elementsToSkip);
}

/**
* Creates a new {@link SkipOperation} skipping the given number of elements.
*
* @param elementsToSkip must not be less than zero.
* @return
*/
public static SkipOperation skip(long elementsToSkip) {
return new SkipOperation(elementsToSkip);
}

/**
* Creates a new {@link LimitOperation} limiting the result to the given number of elements.
*
Expand Down
@@ -1,5 +1,5 @@
/*
* Copyright 2013-2015 the original author or authors.
* Copyright 2013-2016 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -38,7 +38,7 @@ public class SkipOperation implements AggregationOperation {
/**
* Creates a new {@link SkipOperation} skipping the given number of elements.
*
* @param skipCount number of documents to skip.
* @param skipCount number of documents to skip, must not be less than zero.
*/
public SkipOperation(long skipCount) {

Expand Down

0 comments on commit 4875f07

Please sign in to comment.