Uploaded image for project: 'Java Driver'
  1. Java Driver
  2. JAVA-863

gridFs.remove((DBObject)null) removes all elements from bucket

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 2.11.2
    • Fix Version/s: 2.12.0, 3.0.0
    • Component/s: GridFS
    • Labels:
      None
    • Environment:
      java version "1.7.0_25"
      Java(TM) SE Runtime Environment (build 1.7.0_25-b17)
      Java HotSpot(TM) Client VM (build 23.25-b01, mixed mode, sharing)
      Mongodb version: 2.0.6
      Java driver version: 2.11.2
    • # Replies:
      8
    • Last comment by Customer:
      false
    • Sprint:
      Sprint 1

      Description

      When passing null to GridFS.remove(DBObject dbobject) all files of the current bucket are removed. This is inconsistent compared to the other remove() methods of GridFS:

      gridFs.remove((String)null); // nothing happens
      gridFs.remove((ObjectId)null); // nothing happens
      gridFs.remove((DBObject)null); // all files from bucket are removed

      If this is intended behavior it should be documented in the javadoc comment.

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Days since reply:
                3 years, 41 weeks, 3 days ago
                Date of 1st Reply: