carlosvegap / capstone-kickoff

0 stars 0 forks source link

Avoid two queries to update an entry #78

Open CarLosVegga opened 1 year ago

CarLosVegga commented 1 year ago

Do we really need two queries here? Asking since I haven't looked at the documentation.

Couldn't we do something like:

await new Parse.Query('UserPreference').equalTo('username', username).first()
   // now set all the attributes without saving the objectId
  .set('prioritize', prioritize)
   .set(....)

_Originally posted by @vqdo in https://github.com/carlosvegap/capstone-kickoff/pull/66#discussion_r937934241_