Home > Software design >  Conditional Cosmos DB Change Feed
Conditional Cosmos DB Change Feed

Time:12-09

I am "connecting" CosmosDB to an Azure Function by change feed binding. I wonder if there is a way to trigger change feed only when certain property has some specific value.

For instance, a new user is inserted in CosmosDB. Then, run the Azure Function only when the user has user.email != null.

I could filter this out in the Azure Function of course. Just concern about the pricing filtering out potentially thousands of events I don't need.

CodePudding user response:

No this is not currently possible.

There is a 5 year old request on the Feedback site and a response saying the "feature is now planned" but it is unclear when that response was posted as there is no date on it.

For the time being at least you need to filter out any documents not matching your criteria within the function itself rather than being able to get this done server side by CosmosDB when sending the batch of changes.

  • Related