dist/webdb.umd.js
function betweenBounds(node, query, lbm, ubm) {
		var res = [];
		if (!node.hasOwnProperty('key')) { return res; }   // Empty tree
		lbm = lbm || getLowerBoundMatcher(node.tree.compare, query);
		ubm = ubm || getUpperBoundMatcher(node.tree.compare, query);
		if (lbm(node.key) && node.left) { res.push.apply(res, betweenBounds(node.left, query, lbm, ubm)); }
		if (lbm(node.key) && ubm(node.key)) { res.push.apply(res, node.data); }
		if (ubm(node.key) && node.right) { res.push.apply(res, betweenBounds(node.right, query, lbm, ubm)); }
		return res;
	}
function betweenBounds(node, query, lbm, ubm) {
		var res = [];
		if (!node.hasOwnProperty('key')) { return res; }   // Empty tree
		lbm = lbm || getLowerBoundMatcher(node.tree.compare, query);
		ubm = ubm || getUpperBoundMatcher(node.tree.compare, query);
		if (lbm(node.key) && node.left) { res.push.apply(res, betweenBounds(node.left, query, lbm, ubm)); }
		if (lbm(node.key) && ubm(node.key)) { res.push.apply(res, node.data); }
		if (ubm(node.key) && node.right) { res.push.apply(res, betweenBounds(node.right, query, lbm, ubm)); }
		return res;
	}
function betweenBounds ( node , query , lbm , ubm ) { var res = [ ] ; if ( ! node . hasOwnProperty ( 'key' ) ) { return res ; } // Empty tree lbm = lbm || getLowerBoundMatcher ( node . tree . compare , query ) ; ubm = ubm || getUpperBoundMatcher ( node . tree . compare , query ) ; if ( lbm ( node . key ) && node . left ) { res . push . apply ( res , betweenBounds ( node . left , query , lbm , ubm ) ) ; } if ( lbm ( node . key ) && ubm ( node . key ) ) { res . push . apply ( res , node . data ) ; } if ( ubm ( node . key ) && node . right ) { res . push . apply ( res , betweenBounds ( node . right , query , lbm , ubm ) ) ; } return res ; }
Get all data for a key between bounds
Return it in key order
@param {Node} Node to execute on
@param {Object} query Mongo-style query where keys are $lt, $lte, $gt or $gte (other keys are not considered)
@param {Functions} lbm/ubm matching functions calculated at the first recursive step
Get all data for a key between bounds Return it in key order