title: Postman - Compare two responses ignoring order and some specific properties
body: <p>I have two responses that I need to compare, ignoring the order and focusing if the property is there with the same value. Also, ignoring some specific properties as well (which contains in response 1 but should not be in response 2).</p>
  
  <p>I've already tried with deep equal, but it's not what I wanted</p>
  
  <p>-> To save the first response in a global variable:</p>
  
  <pre><code>pm.globals.set("response1", pm.response.json());
  </code></pre>
  
  <p>-> To compare in the second response:</p>
  
  <pre><code>pm.test("Compare responses", function(){    
      pm.expect(pm.response.json()).to.deep.equal(pm.globals.get("response1"));
  });
  </code></pre>
  
  <p>Edit: The responses also contain an array of objects</p>