Created
November 13, 2012 14:16
-
-
Save jensarps/4065969 to your computer and use it in GitHub Desktop.
Examples for IDBWrapper Tutorial, Part 2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var onItem = function (item) { | |
console.log('got item:', item); | |
}; | |
var onEnd = function (item) { | |
console.log('All done.'); | |
}; | |
customers.iterate(onItem, { | |
order: 'DESC', | |
onEnd: onEnd | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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