Uploaded image for project: 'PHP Driver: Library'
  1. PHP Driver: Library
  2. PHPLIB-78

Allow indexes to be dropped by IndexModel (keys and options)

    • Type: Icon: New Feature New Feature
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 1.4.0
    • Affects Version/s: 0.1.0
    • Component/s: None
    • None

      PHPLIB-69 adds support for dropping indexes by name:

      /**
       * Drops a single index from the collection by the index name.
       *
       * In all server versions this MUST execute a dropIndexes command.
       *
       * @note If the string passed is '*', the driver MUST raise an error since
       *   more than one index would be dropped.
       */
      dropIndex(name: String): Result;
      

      We should also support dropping indexes by their key/options combinations, which may be taken directly or in an IndexModel object. Using an IndexModel might allow us the benefit of allowing us to drop indexes returned from enumeration methods.

      /**
       * Attempts to drop a single index from the collection given the keys and options.
       *
       * In all server versions this MUST execute a dropIndexes command.
       *
       * This is OPTIONAL until partial indexes are implemented.
       *
       * @note Drivers MAY opt to implement this method signature, the signature that
       *   takes an IndexModel as a parameter, or for those languages with method
       *   overloading MAY decide to implement both.
       */
      dropIndex(keys: Document, options: IndexOptions): Result;
      
      /**
       * @see Comments above.
       */
      dropIndex(model: IndexModel): Result;
      

            Assignee:
            katherine.walker@mongodb.com Katherine Walker (Inactive)
            Reporter:
            jmikola@mongodb.com Jeremy Mikola
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: