Skip to content

Commit

Permalink
Fix empty pipeline checking logic
Browse files Browse the repository at this point in the history
  • Loading branch information
chathuranga95 committed Feb 12, 2024
1 parent 1bda240 commit 5ab567d
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ public class MongoDBCollectionUtil {
public static Object countDocuments(BHandle collection, Object filter, BArray pipeline) {
MongoCollection<Document> mongoCollection = (MongoCollection<Document>) collection.getValue();
try {
if (pipeline != null) {
long pipelineLength = pipeline.getLength();
if (pipelineLength != 0) {
List<Document> pipelineDoc = new ArrayList<>();
long pipelineLength = pipeline.getLength();
for (int i = 0; i < pipelineLength; i++) {
pipelineDoc.add(Document.parse(pipeline.get(i).toString()));
}
Expand Down

0 comments on commit 5ab567d

Please sign in to comment.