Questions tagged [parse-cloud-code]

This code runs in the Parse Cloud rather than running on a mobile device. For complex apps, sometimes developers just need a bit of logic that isn't running on a mobile device. Cloud Code makes this possible.

The Parse Platform's vision is to let developers build any mobile app without dealing with servers. For complex apps, sometimes developers just need a bit of logic that isn't running on a mobile device. Cloud Code makes this possible.

Cloud Code is easy to use because it's built on the same JavaScript SDK that powers thousands of apps. The only difference is that this code runs in on a Parse Server rather than running on a mobile device. When developers update their Cloud Code, it becomes available to all mobile environments instantly. They don't have to wait for a new release of their application. This lets developers change app behavior on the fly and add new features faster.

1120 questions
7
votes
2 answers

Error: Parse Objects not allowed here

When I try to run count function I get Error: Parse Objects not allowed here E2015-11-09T12:36:10.778Z]v184 Ran cloud function count with: Input: {} Result: Error: Parse Objects not allowed here at n (Parse.js:16:1063) at…
OXXY
  • 1,047
  • 2
  • 18
  • 43
7
votes
2 answers

How do I call a cloud code function with parameters using the Javascript SDK

I know in the iOS sdk I can do it like this [PFCloud callFunctionInBackground:@"email" withParameters:@{@"param1": @"quantity1, @"param2": @"quantity2} block:^(NSString *result, NSError *error) { if (error) { //error } else { …
user379468
  • 3,989
  • 10
  • 50
  • 68
7
votes
3 answers

Check if User has Role - Parse Cloud Code

Writing a Parse Cloud Function (which uses Parse Javascript SDK) and I am having trouble checking to see if the current user has role "Admin". I'm looking at the web view of the Role class and a role with the name "Admin" exists, if I click "View…
Sorry-Im-a-N00b
  • 1,151
  • 2
  • 12
  • 20
6
votes
0 answers

Parse Migration Tool doesn't migrate files (PFFiles)... what can I do?

I store images on Parse's managed database as a field called imageFile. When I ran through the migration guide to move data out to MongoLab, I noticed that the imageFile field doesn't contain any binary data. Instead, it contains a file name only,…
fatuhoku
  • 4,815
  • 3
  • 30
  • 70
6
votes
1 answer

Saving an Image from URL in Parse.com using CloudCode

I have been struggling with saving a file I retrieve from an HTTP Request for a a few days now. Here is my code: Parse.Cloud.httpRequest({ url: "https://ss1.4sqi.net/img/categories_v2/food/vietnamese_88.png", success:…
6
votes
1 answer

Is there a way to check if beforeSave is called for a new Parse object, or for updating an existing object?

I need to check (and take appropriate action) if an object is just being created, or an already-existing object is being updated with new values. Is there any way to check this accurately?
Can Poyrazoğlu
  • 33,241
  • 48
  • 191
  • 389
5
votes
1 answer

How to know if value changed in Parse Cloud Code afterSave hook?

I want to send push notifications every time the value of a single key of my object changes in a parse cloud code afterSave hook. Parse.Cloud.afterSave("Channel", function(request) { var channel = request.object // TODO: check if value of…
5
votes
1 answer

Parse Server Cloud Code Error 141: Unauthorized

I have just created a parse-server deployment for learning on Cloud9 and everything works fine when I am accessing it using the REST API using PostMan. I am now trying out Cloud Functions. I have the following code in my cloud.js…
Samarth Agarwal
  • 2,044
  • 8
  • 39
  • 79
5
votes
1 answer

How to follow a Link to a User in Cloud Code?

In an afterSave Cloud Code function as follows: Parse.Cloud.afterSave("Post", function (request) { var post = request.object; if (post.has('author')) { var author = post.get('author'); // author is a Link to a specific…
Gabriel Bauman
  • 2,270
  • 1
  • 22
  • 36
5
votes
0 answers

Parse Cloud Code: Error: code = 107, "Received an error with invalid JSON from Parse: Cannot POST /parse/classes/Event"; }

I'm trying to successfully get data from a MongoDB Parse database using cloud code implemented in Swift. I am receiving an error code: [Error]: { code = 107; message = "Received an error with invalid JSON from Parse: Cannot POST…
Thomas
  • 147
  • 1
  • 2
  • 8
5
votes
2 answers

Can't get 'underscore' to work with parse server

I just migrated a Parse Server, and everything works, except cloud code. I have come to the understanding that it's because in my main.js I require the library "Underscore". This is my cloud code function: Parse.Cloud.define("ReadyUp",…
5
votes
1 answer

Parse query in cloud code not working after migrating to Heroku

I have migrated my Parse app to Heroku as per the migration guide on the Parse blog. Things seem to work fine except running a query in my cloud code. Here is my code: Parse.Cloud.afterSave("Item", function(request) { …
5
votes
1 answer

Cloud Code: Creating a Parse.File from URL

I'm working on a Cloud Code function that uses facebook graph API to retrieve users profile picture. So I have access to the proper picture URL but I'm not being able to acreate a Parse.File from this URL. This is pretty much what I'm trying: …
adolfosrs
  • 9,286
  • 5
  • 39
  • 67
5
votes
2 answers

Cannot create a pointer to an unsaved ParseObject

I am having troubles referring to a "User" object from inside a query. I have the following code: Parse.Cloud.define("getTabsBadges", function(request, response) { var UserObject = Parse.Object.extend('User'); var user = new UserObject(); …
goodolddays
  • 2,595
  • 4
  • 34
  • 51
5
votes
1 answer

Parse.com Javascript SDK using include, but not working

I'm trying to fetch data from a table called Book. Inside Book there's a Pointer which holds the pointer of one user. The ParseUser has another pointer called Pais (which means Country in spanish). So I want to fetch every single info…
Rafael Ruiz Muñoz
  • 5,333
  • 6
  • 46
  • 92
1
2
3
74 75