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;