Start a new topic

Update Users from Node.js


i have a script which runs through each user of my application once a day to check some values. (All on node.js)

So i do have a User with Master-Credentials, but how can i update the users? If i'm trying to use "PUT" with a REST Call from my node.js script, all values are deleted from the user just the new saved values are saved to the database. Of course i can write a hack to add the "old data" manually on each save, but i think this is a ugly solution.

What did i wrong?

Best, Nico


1 Comment

Hi Nico,

While updating a user, you will need to have following key-value pairs in the PUT request:

  1. old key-values without change
  2. old key-values without change
  3. new key-values

It works the same way with collections as well. This is so because Kinvey uses mongoDB in the backend.

The best way to do this would be to fetch the user object first, edit existing values as necessary, add new key-values and then use the modified object in the PUT request.

Login or Signup to post a comment