Skip to content

Instantly share code, notes, and snippets.

@pivanov
Last active November 22, 2017 00:17
Show Gist options
  • Save pivanov/5fa37d52cd55fb2f9d8a23eed66f9591 to your computer and use it in GitHub Desktop.
Save pivanov/5fa37d52cd55fb2f9d8a23eed66f9591 to your computer and use it in GitHub Desktop.
bla bla
// Parse Server Cloud Code
Parse.Cloud.define('getTotalMessageCount', function(request, response) {
var query = new Parse.Query('Messages');
query.count({ useMasterKey: true }) // count() will use the master key to bypass ACLs
.then(function(count) {
response.success(count);
});
});
Parse.Cloud.define('SomethingCool', function(request, response) {
var query = new Parse.Query('Messages');
query.count({ useMasterKey: true }) // count() will use the master key to bypass ACLs
.then(function(count) {
response.success(count);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment