You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Adds or updates multiple [=object-store/records=] in |store| with the given array of |values|.
2902
+
2903
+
[=/Keys=] can not be explicitly specified using this method, so it can only be used with an [=/object store=] that either has a [=/key generator=] or that uses [=in-line keys=]. Otherwise, a "{{DataError}}" {{DOMException}} will be thrown.
2904
+
2905
+
2906
+
If any [=/record=] fails to be stored, no updates will be made and the |request| will fail, with |request|'s {{IDBRequest/error}} set to an error e.g. a "{{ConstraintError}}" {{DOMException}}.
Adds or updates multiple [=object-store/records=] in |store| with the given array of |entries|. Each entry is a two element array with a [=/key=] and [=/value=] for the record.
2913
+
2914
+
This method can only be used with an [=/object store=] that uses [=out-of-line keys=]. Otherwise, a "{{DataError}}" {{DOMException}} will be thrown.
2915
+
2916
+
If any [=/record=] fails to be stored, no updates will be made and the |request| will fail, with |request|'s {{IDBRequest/error}} set to an error e.g. a "{{ConstraintError}}" {{DOMException}}.
2917
+
2918
+
2896
2919
: |request| = |store| .
2897
2920
{{IDBObjectStore/delete()|delete}}(|query|)
2898
2921
::
@@ -2911,9 +2934,9 @@ and false otherwise.
2911
2934
</div>
2912
2935
2913
2936
2914
-
The <dfn method for=IDBObjectStore>put(|value|, |key|)</dfn> method steps are to return the result of running [=add or put a single record=] with [=/this=], |value|, |key| and the |no-overwrite flag| false.
2937
+
The <dfn method for=IDBObjectStore>put(|value|, |key|)</dfn> method steps are to return the result of running [=add or put a single record=] with [=/this=], |value|, |key| and false.
2915
2938
2916
-
The <dfn method for=IDBObjectStore>add(|value|, |key|)</dfn> method steps are to return the result of running [=add or put a single record=] with [=/this=], |value|, |key| and the |no-overwrite flag| true.
2939
+
The <dfn method for=IDBObjectStore>add(|value|, |key|)</dfn> method steps are to return the result of running [=add or put a single record=] with [=/this=], |value|, |key| and true.
2917
2940
2918
2941
<div algorithm>
2919
2942
@@ -2990,12 +3013,33 @@ To <dfn>add or put a single record</dfn> with |handle|, |value|, |key|, and |no-
2990
3013
2991
3014
</div>
2992
3015
3016
+
The <dfn method for=IDBObjectStore>putAllValues(|values|)</dfn> method steps are to return the result of running [=add or put multiple records=] with [=/this=], |values|, and false.
2993
3017
2994
-
Issue: Define `putAll()` method(s) that use [=/add or put multiple records=].
3018
+
<div algorithm>
3019
+
3020
+
The <dfn method for=IDBObjectStore>putAllEntries(|entries|)</dfn> method steps are:
3021
+
3022
+
1. Let |keys| be a new [=/list=].
3023
+
3024
+
1. Let |values| be a new [=/list=].
3025
+
3026
+
1. [=list/For each=] |entry| of |entries|:
3027
+
3028
+
1. If |entry|'s [=list/size=] is not 2, [=throw=] a [=TypeError=].
3029
+
3030
+
1. [=list/Append=] |entry|[0] to |keys|.
3031
+
3032
+
Note: Keys are not [=convert a value to a key|converted=] until a subsequent step.
3033
+
3034
+
1. [=list/Append=] |entry|[1] to |values|.
3035
+
3036
+
1. Return the result of running [=add or put multiple records=] with [=/this=], |values|, false, and |keys|.
3037
+
3038
+
</div>
2995
3039
2996
3040
<div algorithm>
2997
3041
2998
-
To <dfn>add or put multiple records</dfn> with |handle|, |values|, |keys|, and |no-overwrite flag|, run these steps:
3042
+
To <dfn>add or put multiple records</dfn> with |handle|, |values|, |no-overwrite flag|, and optional |keys|, run these steps:
2999
3043
3000
3044
1. [=/Assert=]: If |keys| is given, |values| [=list/size=] equals |keys| [=list/size=].
3001
3045
@@ -6895,6 +6939,7 @@ For the revision history of the second edition, see [that document's Revision Hi
6895
6939
* Added {{IDBTransactionOptions/durability}} option and {{IDBTransaction/durability}} attribute. ([Issue #50](https://github.com/w3c/IndexedDB/issues/50))
6896
6940
* Specified [[#transaction-scheduling]] more precisely and disallow starting read/write transactions while read-only transactions with overlapping scope are running. ([Issue #253](https://github.com/w3c/IndexedDB/issues/253))
0 commit comments