From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- files/ja/web/api/idbfactory/cmp/index.html | 152 +++++++++++++++++++++++++++++ 1 file changed, 152 insertions(+) create mode 100644 files/ja/web/api/idbfactory/cmp/index.html (limited to 'files/ja/web/api/idbfactory/cmp/index.html') diff --git a/files/ja/web/api/idbfactory/cmp/index.html b/files/ja/web/api/idbfactory/cmp/index.html new file mode 100644 index 0000000000..6c52d63e05 --- /dev/null +++ b/files/ja/web/api/idbfactory/cmp/index.html @@ -0,0 +1,152 @@ +--- +title: IDBFactory.cmp +slug: Web/API/IDBFactory/cmp +tags: + - API + - Database + - IDBFactory + - IndexedDB + - Storage + - cmp +translation_of: Web/API/IDBFactory/cmp +--- +

{{ APIRef("IDBFactory") }}

+
+

{{domxref("IDBFactory")}}インターフェイスのcmp()メソッドは、2つのキーが等価か決定するために比較し、そして、IndexedDBで保存や統合のような操作を命令します。

+
+
+

Note: Do not use this method for comparing arbitrary JavaScript values, because many JavaScript values are either not valid IndexedDB keys (booleans and objects, for example) or are treated as equivalent IndexedDB keys (for example, since IndexedDB ignores arrays with non-numeric properties and treats them as empty arrays, so any non-numeric arrays are treated as equivalent). This throws an exception if either of the values is not a valid key.

+
+

構文

+
var result = window.indexedDB.cmp(a, b);
+

戻り値

+

比較結果を示す整数値。 次のテーブルに可能性のある値とその意味を載せます。:

+ + + + + + + + + + + + + + + + + + + +
戻り値説明
-11つ目のキーが2つ目のキーより小さい
01つ目のキーと2つ目のキーが等しい
11つ目のキーが2つ目のキーより大きい
+

例外

+

このメソッドでは、次の型のような{{domxref("DOMError")}} を持つ {{domxref("DOMException")}}が発生するかもしれません。

+ + + + + + + + + + + +
属性説明
DataError渡されたキーが不正な値である。
+

+
var a = 1;
+var b = 2;
+var result = window.indexedDB.cmp(a, b);
+console.log( "Comparison results: " + result );
+

パラメーター

+
+
+ first
+
+ 比較する1つ目のキー。
+
+ second
+
+ 比較する2つ目のキー。
+
+

仕様

+ + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName('IndexedDB', '#widl-IDBFactory-cmp-short-any-first-any-second', 'cmp')}}{{Spec2('IndexedDB')}} 
+

ブラウザ実装状況

+
+ {{CompatibilityTable}}
+
+ + + + + + + + + + + + + + + + + + + +
FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari (WebKit)
Basic support23{{property_prefix("webkit")}}
+ 24
10 {{property_prefix("moz")}}
+ {{CompatGeckoDesktop("16.0")}}
10, partial157.1
+
+
+ + + + + + + + + + + + + + + + + + + + + +
FeatureAndroidFirefox Mobile (Gecko)Firefox OSIE PhoneOpera MobileSafari Mobile
Basic support4.4{{CompatGeckoMobile("22.0")}}1.0.11022{{CompatNo}}
+
+
+

Chromeは新しい仕様を実装していますが、旧い仕様も実装したままになっているので注意してください。同じように、ベンダプレフィックスなしのindexedDBがあるにもかかわらず、プレフィックス付きのwebkitIndexedDBも実装しています。

+
+

関連情報

+ -- cgit v1.2.3-54-g00ecf