Новости | Документация | Download | Webboard | FAQ | Поиск | Контакты


mongo_remove

(PECL mongo >= 0.8.0)

mongo_removeRemoves documents from a database collection

Описание

bool mongo_remove ( resource $connection , string $ns , array $query , bool $justOne )

Removes objects from a database collection based on criteria.

Список параметров

connection

The database connection to use.

ns

The database and collection name

query

Array of criteria for objects to remove.

justOne

If only one object matching the criteria should be removed.

Возвращаемые значения

If the remove was successful.

Примеры

Пример #1 mongo_remove() example

In this example, all users named Doug are deleted from the users collection of the www database.

<?php

$rquery 
= array("username" => "Doug");

$conn mongo_connect("localhost"true);
if (!
$conn) {
   die(
"Could not connect.");
}
$ok mongo_remove($conn"www.users"$rqueryfalse);

?>

Смотрите также






  Copyright Apache.ru © 1999-2017, All Rights Reserved Разработка сайта: Inside.ru  
  РЕКЛАМА НА САЙТЕ: |