bound 

lower <= key <= upperとなるオブジェクトを全て取得。

boundThan

とは違い、境界を含む

シグネチャ 

deferred = gaviaStoreObject.bound(lower, upper, {
	direction: Gavia.Store.direction,  // optional
	index: 'indexName',                // optional
	offset: Number,                    // optional
	limit: Number,                     // optional
	count: Boolean                     // optional
});

パラメータ 

名前 概要 デフォルト値
direction オブジェクトを探索する方向を指定。 詳しくは後述する。
index indexを指定
offset offset分、最初のオブジェクトを飛ばして取得。 0
limit 取得する最大数。
count trueの場合、取得したオブジェクトの数を返す。 false

Gavia.Store.direction 

Gavia.Store.directionはオブジェクトストアの探索方向を指定するものです。 探索方向は昇順、重複なし昇順、降順、重複なし降順の4つがあります。

名前 概要
Gavia.Store.direction.next 昇順
Gavia.Store.direction.nextunique 重複なし昇順
Gavia.Store.direction.prev 降順
Gavia.Store.direction.prevunique 重複なし降順

サンプル 

// gaviaStoreObject に 1 ~ 9のkeyを持つオブジェクトが存在すると仮定。
gaviaStoreObject.bound(2, 8).done(function(results) {
	console.log(results); // 2 ~ 8
});

gaviaStoreObject.bound(2, 8, {
	direction: Gavia.Store.direction.prev
}).done(function(results) {
	console.log(results); // 8 ~ 2
});

gaviaStoreObject.bound(2, 8, {
	offset: 2,
	limit: 2
}).done(function(results) {
	console.log(results); // 4 ~ 6
});

gaviaStoreObject.bound(2, 8, {
	count: true
}).done(function(count) {
	console.log(count); // 7
});