cloud-code

Parse cloud code ascending / limit won't work in query in promise

泪湿孤枕 提交于 2019-12-11 04:09:23
问题 In the following cloud code, the first query works fine. In the chained query, if you include the two lines of code: query.ascending("createdAt"); // NOTE query.limit(5); // NOTE it does not work! if you comment out those two lines of code, it works great. What could be the problem? It throws no errors, but simply does not execute the .each at all. If you comment out the two lines of code in question, the .each executes perfectly for all results found. Parse.Cloud.define("someFunction",

Query Inside Parse Cloud For Loop

試著忘記壹切 提交于 2019-12-11 02:36:23
问题 I have been trying to run my Parse Cloud Code for some time and can not seem to get around this problem: I have an array of Parse objectId 's called IDArray . I then am sending the array as a parameter of a PFCloud call. Once the array has been sent to the Cloud Code, I can not seem to successfully create a for loop that goes through and updates a number value stored as "points" on Parse for each objectId . In a nutshell, this is all I am trying to accomplish: I just need to be able to have

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

ⅰ亾dé卋堺 提交于 2019-12-10 14:33:51
问题 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", function(request, response) { var _ = require('underscore'); var fbid = request.user.get("fbid"); var query = new Parse.Query("Spel"); query.equalTo("lobby", fbid); query.find().then(function(results) { _.each(results, function(spel) { spel.addUnique("ready",

I am getting the Heroku H12 - Request timeout error for no apparent reason

北城余情 提交于 2019-12-10 12:10:55
问题 In my parse server I have a class called Stats which contains the column timeScore (number) I am using cloud code to update all 250k rows in the column timeScore . My code works well except for the fact that I get the following H12 - Request timeout error for no apparent reason. heroku[router]: at=error code=H12 desc="Request timeout" method=POST path="/parse/functions/timeScore I get the timeout error regardless of what batchSize I choose and I get it every 30 seconds. I get it for a total

Cloud code functions are not executing with Parse server open source API

北慕城南 提交于 2019-12-10 10:03:02
问题 So here's my problem, we're developing a mobile app so 5 month ago when we began, we used Parse for our backend solution. Now Parse will die in a few month but luckily, we can still use Parse server by including their API. But after migrating our DB (implying in the process a lot of anger and despair :p) on mongo and hosting the server on AWS, I cannot execute my cloud code anymore. The functions I defined are not found, and with the Parse dashboard not available anymore, I can't check if my

automatically updating data using cloud code in Parse.com

不问归期 提交于 2019-12-09 13:21:07
问题 I'm looking a method to automatically updating data using cloud code. Let say I have a class Table . inside of it, I have three column : firstname , lastname , and fullname . Currently, I only have firstname and lastname data only. Column fullname is still empty. Is it possible to fill the fullname automatically, by just combining the value in firstname and lastname ? Thank you, 回答1: @RoyH is 100% right to maintain your computed column as new objects are created. To do an initial migration,

Query on pointer in parse.com Objects in Javascript

本小妞迷上赌 提交于 2019-12-08 14:49:11
问题 I have a Class of Company which has User pointers. The query I want on Company class is like this: Retrieve Company rows where User object has a name equal to 'ABC' So, how should I form this query ? var Company = Parse.Object.extend("Company"); var query = Parse.Query(Company); query.include("User"); query.equalTo("name") ???? Is it possible to write such a request in a single query ? Thanks. 回答1: You'll need to query for the User first based on the name of "ABC". Then in the success

Really confused re: how to use Parse Promises correctly in Cloud Code

时光总嘲笑我的痴心妄想 提交于 2019-12-08 07:55:06
问题 Instead of nesting various functions within success completion handlers, I'd like to separate out my functions so that they can either be used independently or in succession. However, I'm super confused regarding the syntax of promises in Parse and have not been able to chain them together successfully despite looking at many other StackOverflow answers (e.g., here, here, here, and here) and Parse's official documentation, overview, and blog post about the topic. Here's an example of my Cloud

How to return a value from a regular javascript function that contains a promise chain?

江枫思渺然 提交于 2019-12-08 06:29:59
问题 function bsfir() { Parse.Promise.as().then(function() { return Parse.Cloud.run('gRFI', {}); }).then(function(gRFIr) { return Parse.Cloud.run('gFI', { }); }).then(function(gFIR) { return gFIR; }, function(error) { return error; }); } Parse.Cloud.define("bSFI", function(request, response) { Parse.Promise.as().then(function() { return bsfir(); }).then(function(bsfirr) { response.success(bsfirr); }, function(error) { response.error("219 error: " + JSON.stringify( error)); }); }); The goal is to

Parse + Heroku Query 500 Error

馋奶兔 提交于 2019-12-08 05:34:21
问题 I used Parse's CLI with the new Heroku integration to create the scaffold NodeJS project ( parse new ). The example cloud function it gives you is: // Hello Parse.Cloud.define('hello', function(request, response) { response.success('Hello world! ' + (request.params.a + request.params.b)); }); I can hit this route with the following CURL command and everything works fine: curl -X POST \ -H "X-Parse-Application-Id: b8qPYS4SLSz0WoSWXlWeQosmF2jJPUPydetg3esR" \ -H "X-Parse-REST-API-Key: