How can I delete changing rows?

Hi, I have some rows I need to insert and after to update or delete if they change. I think I should use an upsert but I don't know how to.

I have:

  • request number (key)
  • request status (number)

If the request is status 1, i have to insert it. If the same request changes and become status 10, i have to delete it. I think I can use the upsert but I don't know exactly how to manage the situation:

        action => "delete"
        doc_as_upsert => "true"
        document_id => "%{request_id}"

Can someone help me? What can i should do?

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.