From 4875f07a92fae3e1321de2211dd74a44ede83513 Mon Sep 17 00:00:00 2001 From: Oliver Gierke Date: Thu, 3 Nov 2016 15:00:20 +0100 Subject: [PATCH] =?UTF-8?q?DATAMONGO-1521=20-=20Added=20Aggregation.skip(?= =?UTF-8?q?=E2=80=A6)=20overload=20to=20support=20longs.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Deprecated the one taking an int. --- .../data/mongodb/core/aggregation/Aggregation.java | 11 +++++++++++ .../data/mongodb/core/aggregation/SkipOperation.java | 4 ++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/Aggregation.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/Aggregation.java index a57db53034..1319c5b25b 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/Aggregation.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/Aggregation.java @@ -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. * diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/SkipOperation.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/SkipOperation.java index 67d598134e..8d87538e8a 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/SkipOperation.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/SkipOperation.java @@ -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. @@ -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) {