Skip to content

Commit 0adeecb

Browse files
committed
Update to return a Stream<Sting,BsonValue> to the aggregate method
Signed-off-by: Otavio Santana <[email protected]>
1 parent 1a30002 commit 0adeecb

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

mongodb-driver/src/main/java/org/eclipse/jnosql/communication/mongodb/document/MongoDBDocumentCollectionManager.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,12 +189,13 @@ public long delete(String collectionName, Bson filter) {
189189
* @return the number of documents deleted.
190190
* @throws NullPointerException when filter or collectionName is null
191191
*/
192-
public Stream<List<jakarta.nosql.document.Document>> aggregate(String collectionName, List<Bson> pipeline) {
192+
public Stream<Map<String, BsonValue>> aggregate(String collectionName, List<Bson> pipeline) {
193193
Objects.requireNonNull(pipeline, "filter is required");
194194
Objects.requireNonNull(collectionName, "collectionName is required");
195195
MongoCollection<Document> collection = mongoDatabase.getCollection(collectionName);
196196
AggregateIterable<Document> aggregate = collection.aggregate(pipeline);
197-
return stream(aggregate.spliterator(), false).map(MongoDBUtils::of);
197+
return stream(aggregate.spliterator(), false)
198+
.map(Document::toBsonDocument);
198199
}
199200

200201
/**

0 commit comments

Comments
 (0)