title: Removing an object from Json Array in file using jackson
body: <p>My <code>JSON</code> looks like below and I need to remove the first object from <code>secondArray</code>.</p>
  
  <pre><code>{
     "firstArray":[
        {
           "data1":1,
           "data2":"DATA"
        },
        {
           "data1":2,
           "data2":"DATA2"
        }
     ],
     "secondArray":[
        {
           "number":1,
           "data":"DATA3",
  
        },
        {
           "number":2,
           "data":"DATA4"
        }
     ]
  }
  </code></pre>
  
  <p>This is what I have so far:</p>
  
  <pre><code>public boolean remove(SecondArray object) {
   try {
    ObjectNode root = (ObjectNode) mapper.readTree(jsonFile);
    ArrayNode array = (ArrayNode) root.get("secondArray");
    if (array.path("number").asInt() == object.getId()) {
     movieArray.remove(object.getId());
    }
    System.out.println(array.toString());
  
   } catch (IOException e) {
    e.printStackTrace();
   }
  }
  </code></pre>
  
  <p>My problem is that <code>object.getId()</code> gets the <code>id</code> as number but in <code>JSON</code> it comes inside " ". How do I make this work, so I could remove the object entered from <code>secondArray</code>?</p>