parse.com-php-library
parse.com-php-library copied to clipboard
How to delete a record by specific field value?
This is how I usually delete a record
- Define object for parse class $parseObject = new parseObject("Authorized_Rooms_Scenes");
- Get objectId for a record I want to delete. $obj_ID=getObjectId($table,$field,$fieldVal); // custom function
- Now I delete as below $parseObject->delete($data);
Is there any way to bypass 2nd step? It's really taking much time for me to parse through all records to find a single objectId. Please someone help me out.
Can't you just query for the objectId? $objectId = $parseQuery->where($field, $fieldVal)
Anyway when you call $parseObject->delete()
you should be using $objectId
as the parameter and not the actual object as you appear to be doing with $data
.