javascript - Parse master key cloud code following users -


I am preparing a simple social network app for iOS with Pars and I am currently working on relationships , Such as followers and following are my followers and in my data browser the following columns are saved as an array so that I can save all the user names. So it is that I am having trouble with this: Say that the current user is looking at user's profiles and clicks, I need to save the name of the current user in the user's follower array which he is looking at. So far as I know that I can not do this on the client side, and in some way it is not a good idea for ether for safety reasons. So I want to try using the master key and cloud code to add every user's name to their proper array. I have never used the cloud code before and I have to make sure that this is the best way to do this. I establish the cloud code, I do not know where to start. Any suggestions would be appreciated!

I will start by creating a new function in main.js in my cloud, code folder just insert Do Parse.Cloud.useMasterKey (); Part of the beginning I will send the object ID of the user that you are modifying, then grab the array from that user in the function and add the existing user to it. Then save and send a successful variable

@ "Users": give objects to the object, block here: ^ (NSString * response, NSError * error) {if (error!) {}}];


Comments

Popular posts from this blog

java - org.apache.http.ProtocolException: Target host is not specified -

java - Gradle dependencies: compile project by relative path -

ruby on rails - Object doesn't support #inspect when used with .include -