[SERVER-42087] Delete query with limit in query does not delete Created: 04/Jul/19  Updated: 05/Jul/19  Resolved: 05/Jul/19

Status: Closed
Project: Core Server
Component/s: Querying
Affects Version/s: 4.0.9
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Debeissat Nicolas Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates JAVA-3346 Delete query is systematically create... Closed
is duplicated by JAVA-3346 Delete query is systematically create... Closed
Operating System: ALL
Steps To Reproduce:

Execute a deleteMany request with a limit parameter like :

db.domainevents.deleteMany(

{ aggregateIdentifier: "2f13501d-6199-425d-899f-cbd51488ec24", limit: "0" }

)

 

Participants:

 Description   

Hello

The following request does not delete anything :

db.domainevents.deleteMany(

{ aggregateIdentifier: "2f13501d-6199-425d-899f-cbd51488ec24", limit: "0" }

)

We have no way to change the sent request in order to remove that "limit" parameters as we are using mongo java driver (https://github.com/mongodb/mongo-java-driver)

behind axon (https://github.com/AxonFramework/AxonFramework)

The following code :

https://github.com/mongodb/mongo-java-driver/blob/f27baf179dfc9de5673a06a3326dea66dcf04dca/driver-core/src/main/com/mongodb/operation/BulkWriteBatch.java

systematically adds limit parameter in the request :

writer.writeInt32("limit", deleteRequest.isMulti() ? 0 : 1);

I will create an issue in that project as well.

 

So we are stuck with that request, and mongodb has no reason not to delete the documents ?

 

Thanks for mongodb



 Comments   
Comment by Ross Lawley [ 05/Jul/19 ]

Handling in the JAVA ticket. Will reopen if needs be.

Generated at Thu Feb 08 04:59:33 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.