Reputation: 3221
I feel very stupid for asking this, but for the life of me, I am unable to figure this out. I just need to take the value of my "wants" field and add 1 to it.
My code is here:
var user = PFUser.currentUser()
let number = user["wants"]
user["wants"] = number + 1
user.save()
Please help me! I'm sure this is probably a very simple process and I'm probably overthinking it!
Upvotes: 1
Views: 424
Reputation: 2994
If this is a counter, you could update it using
PFUser.currentUser().incrementKey("Wants")
and then save the object
more info at the official parse documentation
Upvotes: 1