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

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

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.4.1
    • Affects Version/s: 2.1
    • Component/s: GridFS
    • Environment:
      .NET
    • Fully Compatible

      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.

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

              Created:
              Updated:
              Resolved: