title: Modifying an array property of a resource (participant) during a transaction
body: <p>I want to modify a property of a participant which is an array of relationships during a transaction. </p>
  
  <p>Let's assume I have a user that holds an array of keys like so: </p>
  
  <pre><code>participant User identified by userId {
      o String userId
      --&gt; Key[] keys
  }
  
  asset Key identified by keyId {
      o String keyId
  }
  
  transaction modifyUserKeys {
      --&gt; User user
  }
  </code></pre>
  
  <p>Then in the transaction processor function I modify the array (as in adding and removing elements in it) and update the participant:</p>
  
  <pre><code>function modifyUserKeys(tx) {
      let user = tx.user;
  
      // create a new key via factory 
      var newKey = ...
  
      user.keys.push(newKey);
  
      return getParticipantRegistry('com.sample.User')
      .then(function (participantRegistry) {
          return participantRegistry.update(user);
      });
  }
  </code></pre>
  
  <p>In the <a href="https://hyperledger.github.io/composer/latest/api/common-resource.html" rel="nofollow noreferrer">documentation</a> I saw a method called <code>addArrayValue()</code> which adds an element to an array. Now I'm unsure whether I'm meant to use this over conventional array manipulation like in my example. </p>
  
  <p>What purpose does this <code>addArrayValue()</code> method have and am I able to e.g. remove elements from <code>keys</code> via <code>keys.pop()</code> or is it restricted to just the addition of new elements like the documentation suggests?</p>