aboutsummaryrefslogtreecommitdiff
path: root/files/es/web/api/idbcursor
diff options
context:
space:
mode:
authorPeter Bengtsson <mail@peterbe.com>2020-12-08 14:41:45 -0500
committerPeter Bengtsson <mail@peterbe.com>2020-12-08 14:41:45 -0500
commit1109132f09d75da9a28b649c7677bb6ce07c40c0 (patch)
tree0dd8b084480983cf9f9680e8aedb92782a921b13 /files/es/web/api/idbcursor
parent4b1a9203c547c019fc5398082ae19a3f3d4c3efe (diff)
downloadtranslated-content-1109132f09d75da9a28b649c7677bb6ce07c40c0.tar.gz
translated-content-1109132f09d75da9a28b649c7677bb6ce07c40c0.tar.bz2
translated-content-1109132f09d75da9a28b649c7677bb6ce07c40c0.zip
initial commit
Diffstat (limited to 'files/es/web/api/idbcursor')
-rw-r--r--files/es/web/api/idbcursor/continue/index.html194
-rw-r--r--files/es/web/api/idbcursor/index.html194
2 files changed, 388 insertions, 0 deletions
diff --git a/files/es/web/api/idbcursor/continue/index.html b/files/es/web/api/idbcursor/continue/index.html
new file mode 100644
index 0000000000..90679783b1
--- /dev/null
+++ b/files/es/web/api/idbcursor/continue/index.html
@@ -0,0 +1,194 @@
+---
+title: IDBCursor.continue()
+slug: Web/API/IDBCursor/continue
+tags:
+ - API
+ - Almacen
+ - Basededatos
+ - Continuar
+ - CursorIDB
+ - IndexadoIDB
+ - Referencia
+ - metodo
+translation_of: Web/API/IDBCursor/continue
+---
+<p>{{APIRef("IndexedDB")}}</p>
+
+<p><strong><code>El siguiente()</code></strong> método de la  {{domxref("IDBCursor")}} interfaz, avanza el cursor hacia la siguiente posición a lo largo de su dirección, para el elemento cuya tecla marque la opción de una tecla parámetro. si ninguna tecla es especificada, el cursor avanzará hacia la siguiente posición, bazado en su dirección actual.</p>
+
+<p>{{AvailableInWorkers}}</p>
+
+<h2 id="Sintaxis">Sintaxis</h2>
+
+<pre class="brush: js">cursor.continue(<em>optionalKey</em>);</pre>
+
+<h3 id="Parámetros">Parámetros</h3>
+
+<dl>
+ <dt><em>Tecla opcional</em></dt>
+ <dd>La tecla para posisionar al cursor en.</dd>
+</dl>
+
+<h3 id="Excepciones"><span style="line-height: 1.5;">Excepciones</span></h3>
+
+<p>Este método puede plantear un{{domxref("DOMException")}} con una {{domxref("DOMError")}} de uno de los siguientes tipos:</p>
+
+<table class="standard-table">
+ <thead>
+ <tr>
+ <th scope="col">Excepción</th>
+ <th scope="col">Descripción</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td><code>TransactionInactiveError</code></td>
+ <td>Esta transacción en el Cursor IDB está inactiva.</td>
+ </tr>
+ <tr>
+ <td><code>DataError</code></td>
+ <td>
+ <p>El parámetro de una tecla podría tener una de las siguientes condiciones:</p>
+
+ <ul>
+ <li>La tecla no es una tecla valida.</li>
+ <li>La tecla está más atrás o en el mismo sitio que la posición del cursor y además la dirección del cursor es la siguiente o la única siguiente.</li>
+ <li>La tecla está más adelante o en el mismo sitio que la posición del cursor y además la dirección del cursor es previa o la única previa.</li>
+ </ul>
+ </td>
+ </tr>
+ <tr>
+ <td><code>InvalidStateError</code></td>
+ <td>El cursor está siendo reiterado o se ha reiterado mas allá de su final.<br>
+  </td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="Ejemplo">Ejemplo</h2>
+
+<p>En este simple fragmento nosotros creamos una transacción, recuperar un objeto del almacen, despues usamos un cursor para interactuar a traves de todos los registros en almacen de objetos. El cursor no requiere que nosotros seleccionemos los datos basados en una tecla; podemos tomarlo todo. También es importante resaltar que en cada interacción de la cadena, puedes tomar datos desde el registro actual debajo del objeto del cursor usando<code> </code><code style="font-style: normal; line-height: 1.5;">cursor.value.foo</code><span style="line-height: 1.5;">. Para dar un ejemplo completo, puedes mirar nuestra <a href="https://github.com/mdn/IDBcursor-example/">IDBCursor example</a></span><span style="line-height: 1.5;"> (</span><a href="http://mdn.github.io/IDBcursor-example/" style="line-height: 1.5;">view example live</a><span style="line-height: 1.5;">.)</span></p>
+
+<pre style="font-size: 14px;"><span style="line-height: 1.5;">function displayData() {</span>
+ var transaction = db.transaction(['rushAlbumList'], "readonly");
+ var objectStore = transaction.objectStore('rushAlbumList');
+
+ objectStore.openCursor().onsuccess = function(event) {
+ var cursor = event.target.result;
+ if(cursor) {
+ var listItem = document.createElement('li');
+ listItem.innerHTML = cursor.value.albumTitle + ', ' + cursor.value.year;
+ list.appendChild(listItem);
+
+ cursor.continue();
+ } else {
+ console.log('Entries all displayed.');
+ }
+ };
+};</pre>
+
+<h2 id="Especificaciones">Especificaciones</h2>
+
+<table class="standard-table">
+ <tbody>
+ <tr>
+ <th scope="col">Specification</th>
+ <th scope="col">Estado</th>
+ <th scope="col">Comentarios</th>
+ </tr>
+ <tr>
+ <td>{{SpecName('IndexedDB', '#widl-IDBCursor-continue-void-any-key', 'continue()')}}</td>
+ <td>{{Spec2('IndexedDB')}}</td>
+ <td> </td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="Browser_compatibility" name="Browser_compatibility">Compatibilidad del navegador</h2>
+
+<div>{{CompatibilityTable}}</div>
+
+<div id="compat-desktop">
+<table class="compat-table">
+ <tbody>
+ <tr>
+ <th>Características</th>
+ <th>Chrome</th>
+ <th>Firefox (Gecko)</th>
+ <th>Internet Explorer</th>
+ <th>Opera</th>
+ <th>Safari (WebKit)</th>
+ </tr>
+ <tr>
+ <td>Soporte básico</td>
+ <td>23{{property_prefix("webkit")}}<br>
+ 24</td>
+ <td>10 {{property_prefix("moz")}}<br>
+ {{CompatGeckoDesktop("16.0")}}</td>
+ <td>10, parcial</td>
+ <td>15</td>
+ <td>7.1</td>
+ </tr>
+ <tr>
+ <td>Disponible en workers</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>{{CompatGeckoMobile("37.0")}}</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>{{CompatUnknown}}</td>
+ </tr>
+ </tbody>
+</table>
+</div>
+
+<div id="compat-mobile">
+<table class="compat-table">
+ <tbody>
+ <tr>
+ <th>Características</th>
+ <th>Android</th>
+ <th>Firefox Mobile (Gecko)</th>
+ <th>Firefox OS</th>
+ <th>IE Phone</th>
+ <th>Opera Mobile</th>
+ <th>Safari Mobile</th>
+ </tr>
+ <tr>
+ <td>Soporte básico</td>
+ <td>4.4</td>
+ <td>{{CompatGeckoMobile("22.0")}}</td>
+ <td>1.0.1</td>
+ <td>10</td>
+ <td>22</td>
+ <td>8</td>
+ </tr>
+ <tr>
+ <td>Disponible en workers</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>{{CompatGeckoMobile("37.0")}}</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>{{CompatUnknown}}</td>
+ </tr>
+ </tbody>
+</table>
+</div>
+
+<div class="warning">
+<p>Ten cuidado en Chrome ya que todavía están siendo implementado las antiguas especificaciones con las nuevas. Del mismo modo que todavía tiene la propiedad <code>webkitIndexedDB</code> aun si el<code> indexedDB</code> sin prefijo esta presente.</p>
+</div>
+
+<h2 id="Te_puede_interesar">Te puede interesar</h2>
+
+<ul>
+ <li><a href="/en-US/docs/Web/API/IndexedDB_API/Using_IndexedDB">Using IndexedDB</a></li>
+ <li>Starting transactions: {{domxref("IDBDatabase")}}</li>
+ <li>Using transactions: {{domxref("IDBTransaction")}}</li>
+ <li>Setting a range of keys: {{domxref("IDBKeyRange")}}</li>
+ <li>Retrieving and making changes to your data: {{domxref("IDBObjectStore")}}</li>
+ <li>Using cursors: {{domxref("IDBCursor")}}</li>
+ <li>Reference example: <a class="external" href="https://github.com/mdn/to-do-notifications/tree/gh-pages">To-do Notifications</a> (<a class="external" href="http://mdn.github.io/to-do-notifications/">view example live</a>.)</li>
+</ul>
+
+<p> </p>
diff --git a/files/es/web/api/idbcursor/index.html b/files/es/web/api/idbcursor/index.html
new file mode 100644
index 0000000000..841bf6f9be
--- /dev/null
+++ b/files/es/web/api/idbcursor/index.html
@@ -0,0 +1,194 @@
+---
+title: IDBCursor
+slug: Web/API/IDBCursor
+tags:
+ - API
+ - Database
+ - IDBCursor
+ - IndexedDB
+ - Interface
+ - NeedsTranslation
+ - Reference
+ - Référence(2)
+ - Storage
+ - TopicStub
+translation_of: Web/API/IDBCursor
+---
+<p>{{APIRef("IndexedDB")}}</p>
+
+<p>La interfaz <strong><code>IDBCursor</code></strong> de la <a href="/en-US/docs/IndexedDB">IndexedDB API</a> representa un <a href="/en-US/docs/IndexedDB/Basic_Concepts_Behind_IndexedDB#gloss_cursor">cursor</a> para atravesar o iterar varios registros de una base de datos.</p>
+
+<p>El cursor tiene una fuente que indica el índice o el almacén de objetos sobre el que se está iterando. Tiene una posición dentro del rango y se mueve en una dirección que aumenta o disminuye en el orden de las Keys de registro. El cursor permite a una aplicación procesar asincrónicamente todos los registros del rango del cursor.</p>
+
+<p>Puede tener un número ilimitado de cursores al mismo tiempo. Siempre se obtiene el mismo objeto <code>IDBCursor</code> que representa un cursor determinado. Las operaciones se realizan en el índice subyacente o en el almacén de objetos.</p>
+
+<p>{{AvailableInWorkers}}</p>
+
+<h2 id="Methods">Methods</h2>
+
+<dl>
+ <dt>{{domxref("IDBCursor.advance()")}}</dt>
+ <dd>Establece el número de veces que un cursor debe mover su posición hacia adelante.</dd>
+ <dt>{{domxref("IDBCursor.continue()")}}</dt>
+ <dd>Avanza el cursor a la siguiente posición a lo largo de su dirección, hasta el elemento cuya <code>key</code> coincide con el parámetro clave opcional.</dd>
+</dl>
+
+<dl>
+ <dt>{{domxref("IDBCursor.delete()")}}</dt>
+ <dd>Devuelve un objeto {{domxref("IDBRequest")}} y, en un hilo separado, elimina el registro en la posición del cursor, sin cambiar la posición del cursor. Esto se puede utilizar para borrar registros específicos.</dd>
+ <dd>{{domxref("IDBCursor.update()")}}</dd>
+ <dd>Devuelve un objeto {{domxref("IDBRequest")}} y, en un hilo separado, actualiza el valor en la posición actual del cursor en el almacén de objetos. Esto se puede utilizar para actualizar registros específicos.</dd>
+</dl>
+
+<h2 id="Propiedades">Propiedades</h2>
+
+<dl>
+ <dt>{{domxref("IDBCursor.source")}} {{readonlyInline}}</dt>
+ <dd>Devuelve {{domxref("IDBObjectStore")}} o {{domxref("IDBIndex")}}} que el cursor está iterando. Esta función nunca devuelve nulo o lanza una excepción, incluso si el cursor está siendo iterado, ha iterado más allá de su final, o su transacción no está activa.</dd>
+ <dt>{{domxref("IDBCursor.direction")}} {{readonlyInline}}</dt>
+ <dd></dd>
+ <dd>Devuelve la dirección de desplazamiento del cursor. Ver <a href="#const_next">Constants</a> para valores posibles.</dd>
+ <dd>{{domxref("IDBCursor.key")}} {{readonlyInline}}</dd>
+ <dd>Devuelve la <code>key</code> del registro en la posición del cursor. Si el cursor está fuera de su rango, se fija en <code>undefined</code>. La <code>key</code> del cursor puede ser de cualquier tipo de datos.</dd>
+ <dd>{{domxref("IDBCursor.primaryKey")}} {{readonlyInline}}</dd>
+ <dd>Devuelve la <code>key</code> primaria efectiva actual del cursor. Si el cursor está siendo iterado o ha iterado fuera de su rango, se fija en <code>undefined</code>. La <code>key</code> principal del cursor puede ser cualquier tipo de datos.</dd>
+</dl>
+
+<h2 id="Constants" name="Constants">Constants</h2>
+
+<div>{{ deprecated_header(13) }}</div>
+
+<div class="warning">
+<p>These constants are no longer available — they were removed in Gecko 25. You should use the string constants directly instead. ({{ bug(891944) }})</p>
+</div>
+
+<ul>
+ <li><code>NEXT </code>: <code>"next"</code> : The cursor shows all records, including duplicates. It starts at the lower bound of the key range and moves upwards (monotonically increasing in the order of keys).</li>
+ <li><code>NEXTUNIQUE</code> : <code>"nextunique"</code> : The cursor shows all records, excluding duplicates. If multiple records exist with the same key, only the first one iterated is retrieved. It starts at the lower bound of the key range and moves upwards.</li>
+ <li><code>PREV </code>: <code>"prev"</code> : The cursor shows all records, including duplicates. It starts at the upper bound of the key range and moves downwards (monotonically decreasing in the order of keys).</li>
+ <li><code>PREVUNIQUE </code>: <code>"prevunique"</code> : The cursor shows all records, excluding duplicates. If multiple records exist with the same key, only the first one iterated is retrieved. It starts at the upper bound of the key range and moves downwards.</li>
+</ul>
+
+<h2 id="Ejemplo">Ejemplo</h2>
+
+<p>En este simple fragmento creamos una transacción, recuperamos un almacén de objetos y usamos un cursor para iterar todos los registros del almacén de objetos. El cursor no nos obliga a seleccionar los datos en base a una <code>key</code>; podemos simplemente cogerlos todos. También tenga en cuenta que en cada iteración del bucle, puede tomar datos del registro actual bajo el objeto del cursor utilizando <code style="font-style: normal; line-height: 1.5;">cursor.value.foo</code>. Para un ejemplo completo de funcionamiento, vea nuestro <span style="line-height: 1.5;"><a href="https://github.com/mdn/IDBcursor-example/">IDBCursor example</a></span><span style="line-height: 1.5;"> (</span><a href="http://mdn.github.io/IDBcursor-example/" style="line-height: 1.5;">view example live</a><span style="line-height: 1.5;">.)</span></p>
+
+<pre class="brush: js"><span style="line-height: 1.5;">function displayData() {</span>
+ var transaction = db.transaction(['rushAlbumList'], "readonly");
+ var objectStore = transaction.objectStore('rushAlbumList');
+
+ objectStore.openCursor().onsuccess = function(event) {
+ var cursor = event.target.result;
+ if(cursor) {
+ var listItem = document.createElement('li');
+ listItem.innerHTML = cursor.value.albumTitle + ', ' + cursor.value.year;
+ list.appendChild(listItem);
+
+ cursor.continue();
+ } else {
+ console.log('Entries all displayed.');
+ }
+ };
+}</pre>
+
+<h2 id="Specifications">Specifications</h2>
+
+<table class="standard-table">
+ <tbody>
+ <tr>
+ <th scope="col">Specification</th>
+ <th scope="col">Status</th>
+ <th scope="col">Comment</th>
+ </tr>
+ <tr>
+ <td>{{SpecName('IndexedDB', '#idl-def-IDBCursor', 'cursor')}}</td>
+ <td>{{Spec2('IndexedDB')}}</td>
+ <td></td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="Browser_compatibility" name="Browser_compatibility">Browser compatibility</h2>
+
+<div>{{CompatibilityTable}}</div>
+
+<div id="compat-desktop">
+<table class="compat-table">
+ <tbody>
+ <tr>
+ <th>Feature</th>
+ <th>Chrome</th>
+ <th>Firefox (Gecko)</th>
+ <th>Internet Explorer</th>
+ <th>Opera</th>
+ <th>Safari (WebKit)</th>
+ </tr>
+ <tr>
+ <td>Basic support</td>
+ <td>23{{property_prefix("webkit")}}<br>
+ 24 [1]</td>
+ <td>10 {{property_prefix("moz")}}<br>
+ {{CompatGeckoDesktop("16.0")}}</td>
+ <td>10, partial</td>
+ <td>15</td>
+ <td>7.1</td>
+ </tr>
+ <tr>
+ <td>Available in workers</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>{{CompatGeckoMobile("37.0")}}</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>{{CompatUnknown}}</td>
+ </tr>
+ </tbody>
+</table>
+</div>
+
+<div id="compat-mobile">
+<table class="compat-table">
+ <tbody>
+ <tr>
+ <th>Feature</th>
+ <th>Android</th>
+ <th>Firefox Mobile (Gecko)</th>
+ <th>Firefox OS</th>
+ <th>IE Phone</th>
+ <th>Opera Mobile</th>
+ <th>Safari Mobile</th>
+ </tr>
+ <tr>
+ <td>Basic support</td>
+ <td>4.4</td>
+ <td>{{CompatGeckoMobile("22.0")}}</td>
+ <td>1.0.1</td>
+ <td>10</td>
+ <td>22</td>
+ <td>8</td>
+ </tr>
+ <tr>
+ <td>Available in workers</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>{{CompatGeckoMobile("37.0")}}</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>{{CompatUnknown}}</td>
+ </tr>
+ </tbody>
+</table>
+</div>
+
+<p>[1]Be careful in Chrome as it still implements the old specification along with the new one. Similarly it still has the prefixed <code>webkitIndexedDB</code> property even if the unprefixed <code>indexedDB</code> is present.</p>
+
+<h2 id="See_also">See also</h2>
+
+<ul>
+ <li><a href="/en-US/docs/Web/API/IndexedDB_API/Using_IndexedDB">Using IndexedDB</a></li>
+ <li>Starting transactions: {{domxref("IDBDatabase")}}</li>
+ <li>Using transactions: {{domxref("IDBTransaction")}}</li>
+ <li>Setting a range of keys: {{domxref("IDBKeyRange")}}</li>
+ <li>Retrieving and making changes to your data: {{domxref("IDBObjectStore")}}</li>
+ <li>Using cursors: {{domxref("IDBCursor")}}</li>
+ <li>Reference example: <a class="external" href="https://github.com/mdn/to-do-notifications/tree/gh-pages">To-do Notifications</a> (<a class="external" href="http://mdn.github.io/to-do-notifications/">view example live</a>.)</li>
+</ul>