cloud-code

*Simple* Parse Cloud Code query failure “TypeError: Cannot call method 'get' of undefined\n retrieve that info ”

南楼画角 提交于 2019-12-25 04:19:28
问题 I've been trying to do something very simple for several hours now and I don't know what I'm doing wrong. I'm simple trying to query the username of the first person from my Parse data set via Cloud Code, and then I want to bring that down to my iOS application. Despite all attempts it doesn't seem to be working. Below you'll find my code. Parse.Cloud.define("userName", function(request,response){ var query = new Parse.Query(Parse.User); query.equalTo("username", request.params.username)

Function not updating on Parse.com

ぐ巨炮叔叔 提交于 2019-12-24 16:31:30
问题 I have this function, working normally, on Parse.com: Parse.Cloud.job ("myBGFunction", function(request, status) { console.log("Entering myBGFunction."); }); But as strange as it may seem, if I update it (saving and using parse deploy) as usual with the following: Parse.Cloud.job ("myBGFunction", function(request, status) { console.log("Entering myBGFunction (AAAA)."); }); The next time I try to execute, the old function is executed (in the log), as if the update did go through, though I got

Parse Cloud update unique column

我与影子孤独终老i 提交于 2019-12-24 14:53:16
问题 I have used this code to save the data using Parse Cloud, I have a unique column "number_plate" I am facing a problem and that is when I try to update the object I'm unable to do so. var Car = Parse.Object.extend("Car"); // Check if number plate is set, and enforce uniqueness based on the number plate column. Parse.Cloud.beforeSave("Car", function(request, response) { if (!request.object.get("number_plate")) { response.error('The number plate was not provided.'); } else { var query = new

CloudCode User afterSave requires useMasterKey - why?

淺唱寂寞╮ 提交于 2019-12-24 11:35:03
问题 It woked while ago, but suddenly stopped. Looks like it has something to do with session migration but I don't know why and how to deal with it. So I've got simple cloud code sample: Parse.Cloud.define("hello", function(request, response) { response.success("Hello world!"); }); It works fine naturally. And I want to run it from afterSave trigger like this: Parse.Cloud.afterSave(Parse.User, function(request) { Parse.Cloud.run('hello', { test: 'test'}, { success: function(success) { console.log

Cloud Code function running twice

狂风中的少年 提交于 2019-12-24 02:17:23
问题 I have written a cloud function that is working well. Sometimes this function is being executed more than one time for the same user (I made sure that only one request is being requested from the client android app). After some debugging I noticed that this problem happens if the connection is bad. I may be or may not be correct. How to overcome such an issue? 回答1: As in the comments I also don't believe the client SDKs would duplicate a Cloud Function call on a bad connection. The expected

Parse cloud code new SDK include subclass not working

大兔子大兔子 提交于 2019-12-23 17:16:43
问题 I was using an old parse SDK version 1.5.0 and my function was returning with all the includes. Now I tried to use the latest SDK and the function is returning the main object only (on the gate and location I get "pointers" only.). Here is the code: Parse.Cloud.define("get_gates_for_user", function(request, response) { var userId = request.params.userId; var gateToUserQuery = new Parse.Query("GateUserJoinTable"); gateToUserQuery.equalTo("user", { __type: "Pointer", className: "_User",

Parse cloud code new SDK include subclass not working

让人想犯罪 __ 提交于 2019-12-23 17:14:02
问题 I was using an old parse SDK version 1.5.0 and my function was returning with all the includes. Now I tried to use the latest SDK and the function is returning the main object only (on the gate and location I get "pointers" only.). Here is the code: Parse.Cloud.define("get_gates_for_user", function(request, response) { var userId = request.params.userId; var gateToUserQuery = new Parse.Query("GateUserJoinTable"); gateToUserQuery.equalTo("user", { __type: "Pointer", className: "_User",

Update Stripe module at Parse Cloud Code

余生颓废 提交于 2019-12-22 09:32:30
问题 Turns out that Stripe module at Parse Could Code is out of date and won't be updated. Source: https://developers.facebook.com/bugs/523104684492016/ Parse modules are using an old version of the API and there is no plan to update it in the near future. As a workaround please download the newer SDKs directly off the third party site, place it in "cloud/" folder and import it using require(); We're going to close this by design. I have downloaded Stripe module via terminal with command npm

Is it possible to clone existing cloud code already deployed on server side, through the Parse command line tool?

自作多情 提交于 2019-12-22 09:26:03
问题 How can I clone an existing Parse Cloud Project files to my computer with the command line tool? I tried parse new and selected a project but it created a folder with new files, not the files that I already had in the Parse Cloud. Note: I did not find clue regarding that point in the Parse cloud code documentation neither via Google. Thanks! 回答1: With the new release of parse-cli, this is possible now. Make sure your cli is at least at version 2.2.5 Follow below instructions to download cloud

Possible to get previous value of object in Parse Cloud Code AfterSave?

你离开我真会死。 提交于 2019-12-21 22:38:51
问题 I have an AfterSave function that updates something else based on the previous value of the object that was just saved. Simply knowing that the object has changed with object.existed() is not enough. Is there any way to get the previous value of an object's property without implementing a costly workaround and increasing the number of API calls? Is it even possible to get the previous value of an object in the AfterSave function? When I call object.previous("value") , I get an undefined value