parse.com-php-library icon indicating copy to clipboard operation
parse.com-php-library copied to clipboard

How to delete a record by specific field value?

Open satheesh110 opened this issue 10 years ago • 1 comments

This is how I usually delete a record

  1. Define object for parse class $parseObject = new parseObject("Authorized_Rooms_Scenes");
  2. Get objectId for a record I want to delete. $obj_ID=getObjectId($table,$field,$fieldVal); // custom function
  3. 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.

satheesh110 avatar Mar 31 '14 06:03 satheesh110

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.

jay-neb avatar Mar 31 '14 08:03 jay-neb