aboutsummaryrefslogtreecommitdiff
path: root/files/tr/web/api/idbindex/getall/index.html
blob: dfbd31c48d367f893f62835ce254008d87d57b6b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
---
title: IDBIndex.getAll()
slug: Web/API/IDBIndex/getAll
translation_of: Web/API/IDBIndex/getAll
---
<p>{{ APIRef("IndexedDB") }}</p>

<div>
<p><strong><code>getAll()</code></strong> metodu {{domxref("IDBIndex")}} Arabirimi, dizinin içindeki tüm nesneleri alır.</p>
</div>

<p>Nesne tembel olarak oluşturulduğundan, bir imlecin value özelliğine bakmakla ilişkili bir performans maliyeti söz konusudur. GetAll () gibi bir özellik kullanmak için, tarayıcının tüm nesneleri aynı anda oluşturması gerekir. Örneğin sadece anahtarların her birine bakmak istiyorsanız, bir imleci kullanmak daha etkilidir. Ancak, bir nesne deposundaki tüm nesnelerin bir dizisini almaya çalışıyorsanız, getAll () kullanmalısınız.</p>

<h2 id="Syntax">Syntax</h2>

<pre class="syntaxbox">var getAllKeysRequest = <em>IDBIndex</em>.getAll();
var getAllKeysRequest = <em>IDBIndex</em>.getAll(<em>query</em>);
var getAllKeysRequest = <em>IDBIndex</em>.getAll(<em>query</em>, <em>count</em>);</pre>

<h3 id="Parametreler">Parametreler</h3>

<dl>
 <dt><em>query</em> {{optional_inline}}</dt>
 <dd>A key or an {{domxref("IDBKeyRange")}} identifying the records to retrieve. If this value is null or missing, the browser will use an unbound key range.</dd>
 <dt><em>count</em> {{optional_inline}}</dt>
 <dd>The number records to return. If this value exceeds the number of records in the query, the browser will only retrieve the first item. If it is lower than <code>0</code> or greater than <code>2<sup>32</sup>-1</code> a {{jsxref("TypeError")}} exception will be thrown.</dd>
</dl>

<h3 id="Return_value">Return value</h3>

<p>An {{domxref("IDBRequest")}} object on which subsequent events related to this operation are fired.</p>

<h3 id="Exceptions">Exceptions</h3>

<p>This method may raise a {{domxref("DOMException")}} of the following types:</p>

<table class="standard-table">
 <thead>
  <tr>
   <th scope="col">Exception</th>
   <th scope="col">Description</th>
  </tr>
 </thead>
 <tbody>
  <tr>
   <td><code>TransactionInactiveError</code></td>
   <td>This {{domxref("IDBIndex")}}'s transaction is inactive.</td>
  </tr>
  <tr>
   <td><code>InvalidStateError</code></td>
   <td>The {{domxref("IDBIndex")}} has been deleted or removed.</td>
  </tr>
 </tbody>
</table>

<p>A {{jsxref("TypeError")}} exception is thrown if the <code>count</code> parameter is not between <code>0</code> and <code>2<sup>32</sup>-1</code> included.</p>

<h2 id="Example">Example</h2>

<pre class="brush: js">var myIndex = objectStore.index('index');
var getAllKeysRequest = myIndex.getAllKeys();
getAllKeysRequest.onsuccess = function() {
  console.log(getAllKeysRequest.result);
}</pre>

<h2 id="Specification">Specification</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 2', '#dom-idbindex-getall', 'getAll()')}}</td>
   <td>{{Spec2('IndexedDB 2')}}</td>
   <td>Initial definition.</td>
  </tr>
 </tbody>
</table>

<h2 id="Browser_compatibility">Browser compatibility</h2>

<p>{{ CompatibilityTable }}</p>

<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>{{ CompatChrome(48) }}</td>
   <td>{{ CompatGeckoDesktop("44.0") }} [1]</td>
   <td>{{ CompatNo }}</td>
   <td>{{CompatOpera(35)}}</td>
   <td>{{ CompatNo}}</td>
  </tr>
  <tr>
   <td>Indexed Database 2.0</td>
   <td>{{CompatChrome(58)}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatOpera(45)}}</td>
   <td>{{CompatUnknown}}</td>
  </tr>
 </tbody>
</table>
</div>

<div id="compat-mobile">
<table class="compat-table">
 <tbody>
  <tr>
   <th>Feature</th>
   <th>Android Webview</th>
   <th>Chrome for Android</th>
   <th>Firefox Mobile (Gecko)</th>
   <th>IE Phone</th>
   <th>Opera Mobile</th>
   <th>Safari Mobile</th>
  </tr>
  <tr>
   <td>Basic support</td>
   <td>{{ CompatChrome(48) }}</td>
   <td>{{ CompatChrome(48) }}</td>
   <td>{{ CompatGeckoDesktop("44.0") }} [1]</td>
   <td>{{ CompatNo}}</td>
   <td>{{CompatOperaMobile(35)}}</td>
   <td>{{ CompatNo}}</td>
  </tr>
  <tr>
   <td>Indexed Database 2.0</td>
   <td>{{CompatChrome(58)}}</td>
   <td>{{CompatChrome(58)}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatOperaMobile(45)}}</td>
   <td>{{CompatUnknown}}</td>
  </tr>
 </tbody>
</table>
</div>

<p> [1] This feature was available since Firefox 24, but behind the <code>dom.indexedDB.experimental</code>  pref, off by default</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="https://mdn.github.io/to-do-notifications/">view example live</a>.)</li>
</ul>