Skip to content

Instantly share code, notes, and snippets.

@willdages
willdages / randomParse.js
Created November 24, 2012 14:19 — forked from adelevie/randomParse.rb
randomParse.rb in javascript
var query = new Parse.Query("Classname");
query.count({
error: function(error) {
// Error counting objects
},
success: function(count) {
query.skip(Math.floor(Math.random() * (count - 1)));
query.first({
error: function(error){
// Error getting object