title: Cosmos DB alter collection
body: <p>I am pretty new to Azure so this question might sound a little silly to some, apologies for that! Actually, I have a requirement where I need to alter the structure of an existing cosmos db collection to fit in one additional property. How can I do that with a Stored Procedure? Now,my scenario is somewhat like I have an existing collection which has approximately around 60 documents and the same collection is present in other environments also. I need to add a single property to the collection structure which should ideally be an one time activity.</p>
  
  <p>I have checked <a href="https://stackoverflow.com/questions/50280374/adding-a-new-property-to-cosmos-db">Adding a new property to Cosmos DB</a> but unlike this, my requirement is not to update the collection through code(C#), instead it is through a SP like I said. Now, since we can't use anything apart from SELECT query with Cosmos DB, how do I fit in an ALTER document functionality in the below code snippet?</p>
  
  <pre><code>function updateDocument(documentName){
      var collection = getContext().getCollection();
      var response = getContext().getResponse();
      collection.queryDocuments(
  
       // ALTER document code goes here
  
      );
  }
  </code></pre>