Azure/azure-cosmos-js

Get the change feed for all partitions of a collection

Closed this issue · 7 comments

In order to get the change feed for a partioned collection with readChangeFeed you have to specify a partionKey.

However, if the partition path is the ID of the document, you can only get the change feed of one document.

Is there a way to get the change feed for all partitions of a collection, either with this package or with the REST API?

Today, with the Node.js SDK, you can't monitor all partitions at once, but it is a feature we plan on adding soon.

It is possible to do this via REST API but quite complex because you have to handle the shifting layout of Cosmos DB (increasing number of partitions, partition keys being shifted around, etc.). Would not recommend this approach.

Today, easiest option is to use the Cosmos DB trigger in Azure Functions which does this for Node.js/Java/Python/etc.

@christopheranderson Thanks for your answer! I'll be looking forward to this.

I guess the issue can be closed in favour of #268?

Hi, so you cant get change feed across partitions? How reliable / what grantee is there that the Cosmos DB trigger will never fail? Cosmos DB seems to really come up short when working with many partitions.

@christopheranderson when do you expect to have this feature available?

Probably before end of June. Currently, we point folks to try using Azure Functions if you need change feed processor functionality with JavaScript.

@christopheranderson please could you provide a link to the documentation for this?