title: Accessing json document keys in adapter procedure (IBM worklight)
body: <p>I have a local jsonstore linked to a remote sql database through an adapter. I am trying to push local data to the remote database like this :</p>
  
  <pre><code>submit_data = function () {
  
      accessor.getPushRequired().then(function (result) { alert(result.length);
  
          accessor.push();
  
      });
  </code></pre>
  
  <p>Let us say I only added documents (no replace/remove). 
  I want my add procedure to look like this:</p>
  
  <pre><code>function addGegegr(document) {
  
      //WL.Logger.warn(document[56]);
      return WL.Server.invokeSQLStoredProcedure({
          procedure : "DBO.USP_TIM_add_sp",
              parameters : [document.key1,document.key2,document.key3,...]
      });
  }
  </code></pre>
  
  <p>And same for the replace/remove procedure, they should be calling other stored procedures with the same parameters.</p>
  
  <p>However, I get errors because it seems the variable "document" worklight is passing to the add function after push is called is just a string and not a json object. </p>
  
  <p>So my question is : how do I access the json attributes from the adapter procedure? If not possible, can I pass those attributes to the push function?</p>
  
  <p>P.S.: passing each of the n documents to add as parameter of push() does not work and causes add to be called n*n times instead of n...</p>