Skip to content

Commit e58ccb5

Browse files
committed
fixes delete all query
1 parent a61ef1b commit e58ccb5

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,7 @@ public void delete(DocumentDeleteQuery query) {
127127

128128
String collectionName = query.getDocumentCollection();
129129
MongoCollection<Document> collection = mongoDatabase.getCollection(collectionName);
130-
Bson mongoDBQuery = DocumentQueryConversor.convert(query.getCondition()
131-
.orElseThrow(() -> new IllegalArgumentException("condition is required")));
130+
Bson mongoDBQuery = query.getCondition().map(DocumentQueryConversor::convert).orElse(EMPTY);;
132131
collection.deleteMany(mongoDBQuery);
133132
}
134133

0 commit comments

Comments
 (0)