Last active
November 20, 2020 16:29
-
-
Save alyssoncm/f2f8d1f95aafbc0315e919be79b53de1 to your computer and use it in GitHub Desktop.
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
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