Wrong type for option 'unique' in GridFS constructor

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Major - P3
    • 2.11.3, 3.0.0
    • Affects Version/s: 2.10.1
    • Component/s: GridFS
    • None
    • Environment:
      using mongodb-linux-x86_64-2.4.0
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      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() );
      

              Assignee:
              Jeffrey Yemin
              Reporter:
              Rainer Reich
              None
              Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: