Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

saving pointer with objectId in Parse.Cloud

I am using parse cloud function to some filtering in user table. i have extracted user's objectId and doing some grouping. After that i am having just user's objectId as a string. But now i need to save this objectId as Pointer to the users in another table like in iOS

PFObject *object = [PFObject objectWithoutDataWithClassName:@"Post"objectId:@"objectId"];

Any suggestion to do this in cloud code.

thanks in advance.

like image 880
Srinivas Avatar asked Apr 13 '26 10:04

Srinivas


1 Answers

The equivalent in JavaScript, for a PFUser pointer, would be:

 var userPointer = Parse.User.createWithoutData("myObjectId") ;

This applies to any other class that extends Parse.Object. For example, say that you have a "Foo" class:

 var Foo = Parse.Object.extend("Foo");
 var pointerToFoo = Foo.createWithoutData("myObjectId");

...will work just as well as:

 var Foo = Parse.Object.extend("Foo");
 var pointerToFoo = new Foo();
 pointerToFoo.id = "myObjectId";
like image 50
Héctor Ramos Avatar answered Apr 15 '26 03:04

Héctor Ramos



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!