Azure/azure-cosmos-js

QueryIterator.toArray is not a function

vertho opened this issue · 1 comments

After trying to update to latest (3.0.0-15) i experienced a breaking change in my code.
items.query(SqlQuerySpec, options).toArray() is failing with the following message:

this.container.items.query(...).toArray is not a function

Now, items.query returns a QueryIterator, and according to the docs QueryIterator has a toArray function.

Reading the source code of the Items class, both of the query functions have examples referencing .toArray(), however from version 3.0.0-8 and newer, the toArray() function is missing from QueryIterator.

I downgraded step by step until i found a working version. Last version where QueryIterator has toArray() is 3.0.0-7.

@vertho The 3.0.0-x releases are from our dev branch where we are iterating on next major release. Unfortunately, they are not ready for production usage yet. Lots of doc updates and possibly more breaking changes to come on that branch. Did you install via npm or a different package manager? If you install via npm: npm install @azure/cosmos you should get the latest 2.x.x release