Okay I have a classNamed: "PrivateGroups". Each row in PrivateGroups contains "GroupName" and "Password". In a UIView, if the user enters the GroupName and Password and hits submit, I want to add their user objectId to that specific groupname/password entry under "members".
This is the code I have that isn't working:
var query = PFQuery(className: "PrivateGroups")
query.whereKey("privatename", equalTo: joinname.text)
query.whereKey("password", equalTo: joinpassword.text)
query.findObjectsInBackgroundWithBlock { (objects, error) -> Void in
if objects.count == 1 {
for object in objects {
query.getFirstObject().addUniqueObject(PFUser.currentUser().objectId, forKey: "members")
query.getFirstObject().saveInBackground() }}

so if you match the "members" and "password" and press the button, i want to add the user's object id to "members"