1

dart の indexeddb objectstore で見つかったオブジェクトを反復処理するときにカーソルが取る方向を指定するにはどうすればよいですか?

4

1 に答える 1

1

バージョン 28108 以降、これは次のように機能します。

Future<String> getObject(int keyvalue, String storeName)=>
    db.transactionStore(storeName, "readonly")
      .objectStore(storeName)
      .index("frameId");
      .openCursor(key: keyvalue, direction: "prev", autoAdvance: true)
      .first
      .then((CursorWithValue cursor)=>cursor.value)

方向に使用できる値は、「next」、「nextunique」、「prev」、および「prevunique」です。

この回答はhttps://code.google.com/p/dart/issues/detail?id=2694から取得されました

于 2013-10-03T17:16:33.080 に答える