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

Headers not returned in toArray() if there are results #229

Closed gluwer closed 5 years ago

gluwer commented 6 years ago

Hi,

I know that for toArray() it is not in official docummentation, but as third parameter of callback there is headers from last request returned. The problem is that it works only if there are no results in the query.

The cause is line https://github.com/Azure/azure-documentdb-node/blob/a16b82152f37886dec1d7d7eb301e769179f73ef/source/lib/queryIterator.js#L144 which is executed also in the last callback call which has all params set to undefined effectively clearing the value for all queries that have some results.

Regards, Rafal

southpolesteve commented 5 years ago

We have recently announced deprecation version 1.x of the Azure Cosmos JavaScript SDK. We will end support for the documentdb package and this repo on August 30, 2020. Please update to our new package @azure/cosmos as soon as possible. If you encounter any issues, you can raise them in the Azure central JS SDK repo. If something is preventing you from upgrading to the latest version of the SDK, you can always email me directly: stfaul@microsoft.com