title: How to update a collection using json patch
body: <p>I can't find samples on the way to use JSON Patch to update a collection. In fact, I want to use a method <code>PATCH</code> on a collection REST resource in order to update the associated collection without sending again the whole collection. I wonder if JSON Patch could match to describe the operations to do: mainly add elements or remove elements. Elements are complex, meaning that they aren't primitive elements.</p>
  
  <p>Below there are some more details. Let's take the sample of a resource <code>contacts</code>:</p>
  
  <pre><code>GET /contacts
  [
    {
      "id": "1",
      "lastName": "Last name 1",
      "firstName": "First name 1"
    },
    {
      "id": "2",
      "lastName": "Last name 2",
      "firstName": "First name 2"
    },
    {
      "id": "3",
      "lastName": "Last name 3",
      "firstName": "First name 3"
    },
    (...)
  ]
  </code></pre>
  
  <p>Here is the <code>PATCH</code> request I would like to use but I'm not sure that is JSON Patch compliant:</p>
  
  <pre><code>PATCH /contacts
  [
    {
      "op": "add", "value": {
        "firstName": "my first name",
        "lastName": "my last name"
      }
    },
    {
      "op": "remove", "path": "id=='1'"
    }
  ]
  </code></pre>
  
  <p>My main issue is how to identify the element to delete based on its field <code>id</code>. Is there dedicated expression for this? I thought about something like: <code>id=='1'</code>.</p>
  
  <p>Last question: is the response content targeted by JSON Patch?</p>
  
  <p>Thanks very much by avance for your help!
  Thierry</p>