PhpRiot
Become Zend Certified

Prepare for the ZCE exam using our quizzes (web or iPad/iPhone). More info...


When you're ready get 7.5% off your exam voucher using voucher CJQNOV23 at the Zend Store

Deleting a collection

A collection is deleted by calling deleteCollection().

Example 74. Deleting a collection

<?php
$documents
->deleteCollection("mydata");

Deleting a collection automatically deletes all documents contained in that collection.

Note

Deleting a collection can take significant time for some services. You cannot re-create a collection with the same name until the collection and all its documents have been completely removed.

Deleting a non-existent collection will have no effect.

Zend Framework