title: Does Mongoose work with Cosmos DB with provisioned throughput?
body: <p><strong>Description:</strong></p>
  
  <p>I have setup a new Cosmos DB Database with provisioned throughput.This is to share RU/s for all collections and minimizing cost.</p>
  
  <p>My API accessing Cosmos is a Node.JS with Express and Mongoose.</p>
  
  <p>The database is now setup with <strong>1</strong> collection named <strong>groups</strong> with partition key/shard key <strong>partition</strong></p>
  
  <p>I have used Mongoose with Cosmos DB in the past without issues, but when I try in this mode I receive this error message:</p>
  
  <pre><code>{
  "_t": "OKMongoResponse",
  "ok": 0,
  "code": 2,
  "errmsg": "Shared throughput collection should have a partition key\r\nActivityId: 9217017f-0000-0000-0000-000000000000, Microsoft.Azure.Documents.Common/2.4.0.0",
  "$err": "Shared throughput collection should have a partition key\r\nActivityId: 9217017f-0000-0000-0000-000000000000, Microsoft.Azure.Documents.Common/2.4.0.0",
  "name": "MongoError"
  }
  </code></pre>
  
  <p>I have searched a lot for answers, but I do not see anyone else experiencing the same issue running the same environment.</p>
  
  <p><strong>Environment:</strong></p>
  
  <ul>
  <li>Node version: v10.16.0</li>
  <li>Mongoose version: 5.6.6</li>
  <li>Express version: 4.17.1</li>
  </ul>
  
  <p><strong>Testing:</strong></p>
  
  <p>I have tried setting up the mongoose model like this:</p>
  
  <pre><code>var schema = mongoose.Schema({
      name: String,
  }, { shardKey: { partition: "1" }})
  </code></pre>
  
  <p>And like this:</p>
  
  <pre><code>var schema = mongoose.Schema({
      name: String,
      partition: { type: String, default: "1"},
  })
  </code></pre>
  
  <p>I have also tried to sending the partition key as a value</p>
  
  <pre><code>{
      "name": "Test",
      "partition": "1"
  }
  </code></pre>
  
  <p>If i run the above JSON as a new document in Azure Portal Data Explorer I am able to add the document.</p>
  
  <p>Does anyone know if Mongoose supports Cosmos DB in provisioned throughput-mode?
  And if it is supported, could I please get an example on how to setup mongoose/the model to get it working.</p>
  
  <p>Thanks</p>