Skip to content

Instantly share code, notes, and snippets.

View NearRestaurantsQuery.js
// User's location
const userLocation = myUser.get("location");
// Create a query for Restaurants
const query = new Parse.Query("Restaurant");
// Interested in locations near the User
query.near("location", userLocation);
// Limit the result set to 10 objects
query.limit(10);
// Final list of 10 Restaurants nearest to the User, ordered by Distance ascending
const nearRestaurants = await query.find();
@alexvenom
alexvenom / objectPropetyToUpper.js
Created Apr 19, 2022
Express.JS Function that adds a new Property to a Parse.Object
View objectPropetyToUpper.js
app.post('/touppercase', inflateParseObject, function(req, res) {
let requestData = req.body;
let name = requestData.get("name");
requestData.object.set('upperName', name.toUpperCase());
successResponse(res, requestData.object);
});
View getUserProfile.graphql
query getUserName{
user(id: "MyUser"){
username
photo
address
zipCode
country
city
age
}
View getUserName.graphql
query getUserName{
user(id: "MyUser"){
username
photo
}
}
View me39.graphql
query Me{
viewer {
sessionToken
username
}
}
View me38.graphql
query Me{
viewer {
sessionToken
username
}
}
View me372.graphql
query Me {
users {
me {
objectId,
createdAt,
updatedAt,
username,
sessionToken
}
}
View logIn39.graphql
mutation LogIn{
logIn(fields:{
username: "somefolk"
password: "somepassword"
}){
id,
createdAt,
updatedAt,
username,
sessionToken
View logIn38.graphql
mutation LogIn{
logIn(fields:{
username: "somefolk"
password: "somepassword"
}){
objectId,
createdAt,
updatedAt,
username,
sessionToken
View logIn372.graphql
mutation LogIn {
users {
logIn(username: "somefolk", password: "somepassword") {
objectId,
createdAt,
updatedAt,
username,
sessionToken
}
}