Skip to content

Commit

Permalink
replace Bson array with varargs
Browse files Browse the repository at this point in the history
  • Loading branch information
redmitry committed Oct 13, 2023
1 parent ade5ff2 commit 089b01c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ public long delete(String collectionName, Bson filter) {
* @return the stream of BSON Documents
* @throws NullPointerException when filter or collectionName is null
*/
public Stream<Map<String, BsonValue>> aggregate(String collectionName, Bson[] pipeline) {
public Stream<Map<String, BsonValue>> aggregate(String collectionName, Bson... pipeline) {
Objects.requireNonNull(pipeline, "filter is required");
Objects.requireNonNull(collectionName, "collectionName is required");
MongoCollection<BsonDocument> collection = mongoDatabase.getCollection(collectionName, BsonDocument.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,14 +125,14 @@ public <T> Stream<T> select(Class<T> entity, Bson filter) {
}

@Override
public Stream<Map<String, BsonValue>> aggregate(String collectionName, Bson[] pipeline) {
public Stream<Map<String, BsonValue>> aggregate(String collectionName, Bson... pipeline) {
Objects.requireNonNull(collectionName, "collectionName is required");
Objects.requireNonNull(pipeline, "pipeline is required");
return this.getManager().aggregate(collectionName, pipeline);
}

@Override
public <T> Stream<Map<String, BsonValue>> aggregate(Class<T> entity, Bson[] pipeline) {
public <T> Stream<Map<String, BsonValue>> aggregate(Class<T> entity, Bson... pipeline) {
Objects.requireNonNull(entity, "entity is required");
Objects.requireNonNull(pipeline, "pipeline is required");
EntityMetadata entityMetadata = this.entities.get(entity);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public interface MongoDBTemplate extends JNoSQLDocumentTemplate {
* @return the stream result
* @throws NullPointerException when pipeline or collectionName is null
*/
Stream<Map<String, BsonValue>> aggregate(String collectionName, Bson[] pipeline);
Stream<Map<String, BsonValue>> aggregate(String collectionName, Bson... pipeline);

/**
* Aggregates documents according to the specified aggregation pipeline.
Expand All @@ -94,7 +94,7 @@ public interface MongoDBTemplate extends JNoSQLDocumentTemplate {
* @return the stream result
* @throws NullPointerException when pipeline or entity is null
*/
<T> Stream<Map<String, BsonValue>> aggregate(Class<T> entity, Bson[] pipeline);
<T> Stream<Map<String, BsonValue>> aggregate(Class<T> entity, Bson... pipeline);

/**
* Aggregates documents according to the specified aggregation pipeline.
Expand Down

0 comments on commit 089b01c

Please sign in to comment.