2

I have a custom cloud code method to create a parse object. I'm doing that so I can validate the uniqueness of a few pointer objects, etc.

When I create the object I need to create, can I set the non validated pointers via the object id I get from the client side?

Something like object.set("user", "someuserid");

I'd like to avoid doing the extra find queries if I can when I already have the id.

2 Answers 2

4

You certainly can so long as you create a new pointer and assign the objectId.

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

There is also a shortcut you can use called createWithoutData

Sign up to request clarification or add additional context in comments.

1 Comment

Exactly what I was looking for.
0

there is one simple shortcut method you just pass objectId to createWithoutData function

Parse.User.createWithoutData(req.body.objectId);

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.