/** * Returns information about indexes on this collection * * @return array - This function returns an array in which each element * describes an index. Elements will contain the values name for the * name of the index, ns for the namespace (a combination of the * database and collection name), and key for a list of all fields in * the index and their ordering. Additional values may be present for * special indexes, such as unique or sparse. */ public function getIndexInfo() { $indexes = $this->db->getIndexesCollection()->find(['ns' => $this->fqn]); return iterator_to_array($indexes); }