Azure / azure-cosmosdb-node

We recently announced deprecation of JS v1 SDK and this repo. Starting September 2020 Microsoft will not provide support for this library. Existing applications using library will continue to work as-is. We strongly recommend upgrading to @azure/cosmos library.
https://github.com/Azure/azure-sdk-for-js
MIT License
141 stars 108 forks source link

QUESTION: What is the proper REST request option for throughput? #232

Closed NoCopy closed 6 years ago

NoCopy commented 6 years ago

I have tried submitting 'offerThroughput:20000' and just 'throughput:20000' but both options end up at 5100(?!). Looking at the REST API I understand it accepts a request header however it looks like that is being translated by this node lib?

  • @property {number} [offerThroughput] - The offer throughput provisioned for a collection in measurement of Requests-per-Unit in the Azure Cosmos DB database service.

AND

    if (options.offerThroughput) {headers[Constants.HttpHeaders.OfferThroughput] = options.offerThroughput;}

I am creating a partition key as well

Full options (in COLLECTION):

COSMOS: { DB: 'XXX', COLLECTION: { 'id': 'YYY', 'offerThroughput': 20000, 'partitionKey': { 'paths': [ '/ZZZ' ], 'kind': 'Hash' } } }

Also, I apologize for the formatting of the code object, I tried 100 different f**king space options but no idea what markdown expects today; so I chose to get on my with my life.

NoCopy commented 6 years ago

Not sure if this was an emulator issue only but in the proper cosmos db environment this appears to be working. I also went back and checked, with the latest cosmos db emulator installed this also appears ok. Closing issue.