0

I have a database on Parse.com. There is a table called EventsUsers that contains eventId as string and userId as pointer on user everything looks like this:

eventId : eventId,
userId : {
  __type : "Pointer",
  className : "_User",
  objectId : userId
}

I need to create row in this table, but I don't know how to create the pointer. This is what I have done yet, it creates the row without the pointer.

ParseObject po = new ParseObject("EventsUsers");
po.put("eventId", event.getId());
po.saveInBackground();

1 Answer 1

2

You can implement it like this, an example with current user.

ParseObject po = new ParseObject("EventsUsers"); 
po.put("eventId", event.getId()); 
po.put("userid",ParseUser.getCurrentUser();
po.saveInBackground();

Hope this helps :)

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

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.