Docs Menu

Docs HomePHP Library Manual

MongoDB\Collection::dropSearchIndex()

On this page

  • Definition
  • Parameters
  • Errors/Exceptions
  • See Also

New in version 1.17.

MongoDB\Collection::dropSearchIndex()

Drop an Atlas Search index for the collection.

function dropSearchIndex(string $name, array $options = []): void

This command can only be run on a deployment hosted on MongoDB Atlas and requires an Atlas cluster tier of at least M10. A Local Atlas Deployment can also be used for development.

$name : string
Name of the index to drop.
$options : array

An array specifying the desired options.

Name
Type
Description
comment
mixed

Enables users to specify an arbitrary comment to help trace the operation through the database profiler, currentOp output, and logs.

MongoDB\Exception\UnsupportedException if options are used and not supported by the selected server (e.g. collation, readConcern, writeConcern).

MongoDB\Exception\InvalidArgumentException for errors related to the parsing of parameters or options.

MongoDB\Driver\Exception\RuntimeException for other errors at the driver level (e.g. connection errors).

← MongoDB\Collection::dropIndexes()