mirror of
https://github.com/php/doc-es.git
synced 2026-03-25 16:02:13 +01:00
git-svn-id: https://svn.php.net/repository/phpdoc/es/trunk@336506 c90b9560-bf6c-de11-be94-00142212c4b1
242 lines
7.2 KiB
XML
242 lines
7.2 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- $Revision$ -->
|
|
<!-- EN-Revision: 13445ae645cc80ee9b69e10b8b3f94070b8d865b Maintainer: seros Status: ready -->
|
|
<!-- Reviewed: no -->
|
|
|
|
<refentry xml:id="mongocollection.remove" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
<refnamediv>
|
|
<refname>MongoCollection::remove</refname>
|
|
<refpurpose>Eliminar registros de esta colección</refpurpose>
|
|
</refnamediv>
|
|
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<modifier>public</modifier> <type>bool|array</type><methodname>MongoCollection::remove</methodname>
|
|
<methodparam choice="opt"><type>array</type><parameter>criteria</parameter><initializer>array()</initializer></methodparam>
|
|
<methodparam choice="opt"><type>array</type><parameter>options</parameter><initializer>array()</initializer></methodparam>
|
|
</methodsynopsis>
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
<varlistentry xml:id="mongocollection.remove.criteria">
|
|
<term>
|
|
<parameter>criteria</parameter>
|
|
</term>
|
|
<listitem>
|
|
<para>
|
|
Criterios de consulta para los documentos a borrar.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term>
|
|
<parameter>options</parameter>
|
|
</term>
|
|
<listitem>
|
|
<para>
|
|
Un array de opciones para la operación de eliminación. Las opciones actualmente
|
|
disponibles son:
|
|
<itemizedlist>
|
|
&mongo.writes.parameters.writeconcern;
|
|
<listitem xml:id="mongocollection.remove.justone">
|
|
<para>
|
|
<literal>"justOne"</literal>
|
|
</para>
|
|
<para>
|
|
Especificar &true; para limitar la eliminación a sólo un documento. Si es &false; o
|
|
se omite, se borrarán todos los documentos que coincidan con los criterios.
|
|
</para>
|
|
</listitem>
|
|
&mongo.writes.parameters.fsync;
|
|
&mongo.writes.parameters.journal;
|
|
&mongo.writes.parameters.sockettimeoutms;
|
|
&mongo.writes.parameters.writeconcern;
|
|
&mongo.writes.parameters.writeconcerntimeoutms;
|
|
</itemizedlist>
|
|
</para>
|
|
<para>
|
|
Las siguientes opciones están obsoletas y no deberían usarse más:
|
|
<itemizedlist>
|
|
&mongo.writes.parameters.safe;
|
|
&mongo.writes.parameters.timeout;
|
|
&mongo.writes.parameters.writeconcerntimeout;
|
|
</itemizedlist>
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
Devuelve un array que contiene el estado de la eliminación si está
|
|
establecida la opción <literal>"w"</literal>. De lo contrario, devuelve &true;.
|
|
</para>
|
|
<para>
|
|
Los campos del array de estado están descritros en la documentación de
|
|
<function>MongoCollection::insert</function>.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="errors">
|
|
&reftitle.errors;
|
|
&mongo.errors.exceptions.writeconcern;
|
|
</refsect1>
|
|
|
|
<refsect1 role="changelog">
|
|
&reftitle.changelog;
|
|
<para>
|
|
<informaltable>
|
|
<tgroup cols="2">
|
|
<thead>
|
|
<row>
|
|
<entry>&Version;</entry>
|
|
<entry>&Description;</entry>
|
|
</row>
|
|
</thead>
|
|
<tbody>
|
|
<row>
|
|
<entry>1.5.0</entry>
|
|
<entry>
|
|
<para>
|
|
se añadió la opción <literal>"wTimeoutMS"</literal>, la cual remplaza a
|
|
<literal>"wtimeout"</literal>. Emite un error de nivel <constant>E_DEPRECATED</constant>
|
|
cuando se usa <literal>"wtimeout"</literal>.
|
|
</para>
|
|
<para>
|
|
Se añadió la opción <literal>"socketTimeoutMS"</literal>, la cual remplza a
|
|
<literal>"timeout"</literal>. Emite un error de nivel <constant>E_DEPRECATED</constant>
|
|
cuando se usa <literal>"timeout"</literal>.
|
|
</para>
|
|
<para>
|
|
Emite un error de nivel <constant>E_DEPRECATED</constant> al
|
|
usar <literal>"safe"</literal>.
|
|
</para>
|
|
</entry>
|
|
</row>
|
|
<row>
|
|
<entry>1.3.4</entry>
|
|
<entry>Se añadió la opción <literal>"wtimeout"</literal>.</entry>
|
|
</row>
|
|
<row>
|
|
<entry>1.3.0</entry>
|
|
<entry>
|
|
<para>Se añadió la opción <literal>"w"</literal>.</para>
|
|
<para>
|
|
El parámetro <parameter>options</parameter> ya no acepta un valor booleano
|
|
que indique <literal>"justOne"</literal>. En su lugar, ahora se debe hacer
|
|
con <literal>array('justOne' => true)</literal>.
|
|
</para>
|
|
</entry>
|
|
</row>
|
|
<row>
|
|
<entry>1.2.11</entry>
|
|
<entry>
|
|
Emite un error de nivel <constant>E_DEPRECATED</constant> cuando
|
|
<parameter>options</parameter> es de tipo <type>scalar</type>.
|
|
</entry>
|
|
</row>
|
|
<row>
|
|
<entry>1.2.0</entry>
|
|
<entry>Se añadió la opción <literal>"timeout"</literal>.</entry>
|
|
</row>
|
|
<row>
|
|
<entry>1.0.11</entry>
|
|
<entry>
|
|
Se desconcecta cuando ocurren errores "not master" si <literal>"safe"</literal> está establecido.
|
|
</entry>
|
|
</row>
|
|
<row>
|
|
<entry>1.0.9</entry>
|
|
<entry>
|
|
<para>
|
|
Se añadió la capacidad de pasar números enteros a la opción <literal>"safe"</literal>,
|
|
la cual anteriomente sólo aceptaba valores booleanos.
|
|
</para>
|
|
<para>
|
|
Se añadío la opción <literal>"fsync"</literal>.
|
|
</para>
|
|
<para>
|
|
Es tipo devuelto se cambio para que fuera un array que contuviera la información del error
|
|
si se usaba la opción <literal>"safe"</literal>. De otro modo, se devolvía
|
|
un valor booleano como antes.
|
|
</para>
|
|
</entry>
|
|
</row>
|
|
<row>
|
|
<entry>1.0.5</entry>
|
|
<entry>
|
|
Cambiado el segundo parámetro a un array de opciones. Antes de 1.0.5, el
|
|
segundo parámetro era un booleano indicando la opción
|
|
<literal>"safe"</literal>.
|
|
</entry>
|
|
</row>
|
|
</tbody>
|
|
</tgroup>
|
|
</informaltable>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<example>
|
|
<title>Ejemplo de <function>MongoCollection::remove</function> con justOne</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
|
|
$radioactivo = $db->radioactivo;
|
|
|
|
// contar cuánto plution queda
|
|
$restante = $radioactivo->count(array('type' => 94));
|
|
|
|
$vidamedia = $restante/2;
|
|
|
|
// eliminar la mitad
|
|
while ($vidamedia > 0) {
|
|
$radioactivo->remove(array('type' => 94), array("justOne" => true));
|
|
$vidamedia--;
|
|
}
|
|
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</refsect1>
|
|
|
|
<refsect1 role="seealso">
|
|
&reftitle.seealso;
|
|
<simplelist>
|
|
<member><function>MongoCollection::insert</function></member>
|
|
<member><function>MongoCollection::update</function></member>
|
|
<member>Documentación de MongoDB sobre <link xlink:href="&url.mongodb.dochub.remove;">remove</link>.</member>
|
|
</simplelist>
|
|
</refsect1>
|
|
|
|
</refentry>
|
|
<!-- Keep this comment at the end of the file
|
|
Local variables:
|
|
mode: sgml
|
|
sgml-omittag:t
|
|
sgml-shorttag:t
|
|
sgml-minimize-attributes:nil
|
|
sgml-always-quote-attributes:t
|
|
sgml-indent-step:1
|
|
sgml-indent-data:t
|
|
sgml-parent-document:nil
|
|
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
|
|
sgml-exposed-tags:nil
|
|
sgml-local-catalogs:nil
|
|
sgml-local-ecat-files:nil
|
|
End:
|
|
vim600: syn=xml fen fdm=syntax fdl=2 si
|
|
vim: et tw=78 syn=sgml
|
|
vi: ts=1 sw=1
|
|
-->
|