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

Wrong type for option 'unique' in GridFS constructor

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • 2.11.3, 3.0.0
    • 2.10.1
    • GridFS
    • None
    • using mongodb-linux-x86_64-2.4.0

    Description

      In the ctor of GridFS the following call on DBCollection#ensureIndex sets a wrong value respectively the wrong type for option "unique", so that the index will not be found even if it exists:

      _chunkCollection.ensureIndex( BasicDBObjectBuilder.start().add( "files_id" , 1 ).add( "n" , 1 ).get() , BasicDBObjectBuilder.start().add( "unique" , 1 ).get() );

      The correct value would be true instead of 1:

      _chunkCollection.ensureIndex( BasicDBObjectBuilder.start().add( "files_id" , 1 ).add( "n" , 1 ).get() , BasicDBObjectBuilder.start().add( "unique" , true ).get() );

      Attachments

        Activity

          People

            jeff.yemin@mongodb.com Jeffrey Yemin
            rre Rainer Reich
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: