php8.5
Home/ Manual/ mysql_xdevapi / collectionremove/ CollectionRemove::limit

CollectionRemove::limit

PHP function Edit on GitHub ✎

Limit number of documents to remove

Description

mysql_xdevapi\CollectionRemove::limit(int $rows): mysql_xdevapi\CollectionRemove

Sets the maximum number of documents to remove.

Func

Parameters

rows

The maximum number of documents to remove.

Return Values

Returns a CollectionRemove object that can be used to execute the command, or to add additional operations.

Examples

mysql_xdevapi\CollectionRemove::limit() example

php
<?php

$res = $coll->remove('job in (\'Barista\', \'Programmatore\', \'Ballerino\', \'Programmatrice\')')->limit(5)->sort(['age desc', 'name asc'])->execute();

?>

Source: reference/mysql_xdevapi/mysql_xdevapi/collectionremove/limit.xml · from the official PHP manual (php/doc-en)