3

Using shiki/kaiseki to interact with Parse API. How can I save a user pointer to an object?

If I query users:

kaisekiClient.getObjects('_User', function (err, res, json) {
  json[0].objectId 
  // 'pBIb9ncQDv'
})

But if I try to create an object it errors.

kaisekiCient.createObject('Thing', {
  user: {
    __type: 'Pointer',
    className: '_User',
    objectId: 'pBIb9ncQDv'
  }
}

// { code: 111, 
//   error: 'invalid type for key user, expected *User, but got *_User' }

Are references supposed to use User instead of _User? Why would _User be needed as the className for fetching objects, but not for referencing them?

4
  • looks like your column 'user' is set up wrong. It should show as a Pointer<_User> not Pointer<User>. Commented Jul 7, 2014 at 19:52
  • how would I fix the column? Commented Jul 7, 2014 at 19:59
  • 1
    Drop it and re-add it (or just drop it, and run this code which will automatically add it.) Commented Jul 7, 2014 at 20:02
  • Thanks @Fosco. If you add as an answer to drop on parse website, I'll accept. Commented Jul 7, 2014 at 22:07

1 Answer 1

2

It looks like your column 'user' is set up wrong. It should show as a Pointer<_User> not Pointer<User>. Drop the column from the Data Browser and re-add it (or just drop it, and run this code which will automatically add it.)

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.