Uploaded image for project: 'C# Driver'
  1. C# Driver
  2. CSHARP-1866

GridFS should check whether indexes already exist before trying to create them

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • 2.1
    • 2.4.1
    • GridFS
    • .NET
    • Fully Compatible

    Description

      In our application we have some security restrictions for user which uses GridFS.
      User granted actions are: "insert", "remove", "update", "find".
      We don't want to grant database management actions, such as "createIndex", to application user.
      In our situation OpenUploadStream method in GridFSBucket class try to create index for GridFS collection (because collection is empty) and fails with MongoCommandException "not authorized on DBNAME to execute command { createIndexes: "COLLECTIONNAME.files"...".
      I can send pull request with checking if index already exists to avoid index creation.
      But it is fundamentally wrong to do DBA's work from driver.
      DBA should create all necessary indexes from deployment script.

      Attachments

        Issue Links

          Activity

            People

              robert@mongodb.com Robert Stam
              tomak_k.s. Tomak Ksenia
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: