title: How to query cosmos db for some documents, change their properties and save them back
body: <p>I am struggling with an azure function. The goal of the function is to get some objects from cosmos db, update them, and save them back.</p>
  
  <p>The function looks more or less like this</p>
  
  <pre><code>[FunctionName("update-in-cosmosdb")]
  public async Task&lt;IActionResult&gt; Run(
          [HttpTrigger(AuthorizationLevel.Function, "post", Route = null)] HttpRequestMessage req,
          [CosmosDB(
              databaseName: "name",
              collectionName: "col-name",
              ConnectionStringSetting = "COSMOSDB-CONNECTIONSTRING")] DocumentClient client,
          ILogger log)
      {
          var documentDatabase = Environment.GetEnvironmentVariable("DB-NAME");
          var documentCollection = Environment.GetEnvironmentVariable("COL-NAME");
          var uri = UriFactory.CreateDocumentCollectionUri(documentDatabase, documentCollection);
          var query = client.CreateDocumentQuery&lt;MyModelClass&gt;(uri,
              "SELECT TOP 10 c.id, c.PropertyToChange  FROM c WHERE c.id IN (" + ids+ ")", new FeedOptions {EnableCrossPartitionQuery = true}).ToList();
  
          foreach (var o in query)
          {
              o.PropertyToChange = someNewValue;
          }
  </code></pre>
  
  <p>then I would like to save update the corresponding documents in cosmos-db. What should be the way of doing this? What can be important is the fact, that MyModelClass contains only a few of the properties - the document in cosmos-db is way lot more complicated and I don't want to touch the other properties. MyModelClass of course contains Id</p>