I use JS business logic. My Users table has ‘following’ column. I want to use afterRegister event to insert some special User into ‘following’ column (one to many Users) of registered user. I can get my special user via DataQuery.
But there is no ‘following’ array in req.user, there is only password and email. How I can get ‘following’ array of current registered user?
Thanks
Retrieving the user object with DataQuery and specifying in it that you want a specific related property (the “following” property in your case) is the way to do it. So you’re on the right track.
You use DataQuery to retrieve a user which you want to update. This docs describes how to use the DataQuery: https://backendless.com/documentation/data/js/data_search_and_query.htm
After that, when you have a user object, you can update it as it is described in the doc page I provided above.
If your case is more complex or you have any issue with using the SDK, then yes, please create a new topic so that we would be able to investigate your case separately.