Skip to content
This repository has been archived by the owner on Feb 25, 2018. It is now read-only.

How to delete a record by specific field value? #143

Open
satheesh110 opened this issue Mar 31, 2014 · 1 comment
Open

How to delete a record by specific field value? #143

satheesh110 opened this issue Mar 31, 2014 · 1 comment

Comments

@satheesh110
Copy link

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.

@jay-neb
Copy link

jay-neb commented Mar 31, 2014

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants