Skip to content

Instantly share code, notes, and snippets.

@vseventer
Created July 31, 2012 15:27
Show Gist options
  • Select an option

  • Save vseventer/3217817 to your computer and use it in GitHub Desktop.

Select an option

Save vseventer/3217817 to your computer and use it in GitHub Desktop.
Kinvey JavaScript Library: Leaderboard example.
var collection = new Kinvey.Collection('scores', {
store: 'cached',
options: { policy: 'cachefirst' }
});
// The leaderboard should override the collections cachefirst policy.
var leaderboard = new Kinvey.Aggregation().on('player');
collection.aggregate(leaderboard, {
policy: 'nocache',// Overrides cachefirst policy.
success: function(response) {
// response is the leaderboard.
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment