Skip to content

Instantly share code, notes, and snippets.

@jensarps
Created November 13, 2012 14:16
Show Gist options
  • Save jensarps/4065969 to your computer and use it in GitHub Desktop.
Save jensarps/4065969 to your computer and use it in GitHub Desktop.
Examples for IDBWrapper Tutorial, Part 2
var onItem = function (item) {
console.log('got item:', item);
};
var onEnd = function (item) {
console.log('All done.');
};
customers.iterate(onItem, {
order: 'DESC',
onEnd: onEnd
});
var onItem = function (item) {
console.log('got item:', item);
};
var onEnd = function (item) {
console.log('All done.');
};
customers.iterate(onItem, {
index: 'lastname',
filterDuplicates: true,
onEnd: onEnd
});
var onItem = function (item) {
console.log('got item:', item);
};
var onEnd = function (item) {
console.log('All done.');
};
var keyRange = customers.makeKeyRange({
lower: 'Doe',
upper: 'Doe'
});
customers.iterate(onItem, {
index: 'lastname',
keyRange: keyRange,
onEnd: onEnd
});
var onItem = function (item) {
console.log('got item:', item);
};
var onEnd = function (item) {
console.log('All done.');
};
var keyRange = customers.makeKeyRange({
lower: 'G'
});
customers.iterate(onItem, {
index: 'lastname',
keyRange: keyRange,
filterDuplicates: true,
onEnd: onEnd
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment