Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-42087

Delete query with limit in query does not delete

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Major - P3
    • Resolution: Duplicate
    • 4.0.9
    • None
    • Querying
    • None
    • ALL
    • Hide

      Execute a deleteMany request with a limit parameter like :

      db.domainevents.deleteMany(

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

      )

       

      Show
      Execute a deleteMany request with a limit parameter like : db.domainevents.deleteMany( { aggregateIdentifier: "2f13501d-6199-425d-899f-cbd51488ec24", limit: "0" } )  

    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

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              debeissat_nicolas Debeissat Nicolas
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: