Skip to content

Instantly share code, notes, and snippets.

@alyssoncm
Last active November 20, 2020 16:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alyssoncm/f2f8d1f95aafbc0315e919be79b53de1 to your computer and use it in GitHub Desktop.
Save alyssoncm/f2f8d1f95aafbc0315e919be79b53de1 to your computer and use it in GitHub Desktop.
Parse.Cloud.define("DogsBetweenAges", async (request) => {
// Returns all Dogs that are between two given ages
const query = new Parse.Query("Dog");
query.greaterThanOrEqualTo("minimumAge", request.params.minimumAge); // Uses the minimumAge parameter
query.lessThanOrEqualTo("maximumAge", request.params.maximumAge); // Uses the maximumAge parameter
const results = await query.find();
return results
},{
fields : ['minimumAge', 'maximumAge'],
requireUser: true
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment