Add Azure Cosmos DB for MongoDB trigger, input, and output bindings#418
Open
xingfan-git wants to merge 2 commits intov4.xfrom
Open
Add Azure Cosmos DB for MongoDB trigger, input, and output bindings#418xingfan-git wants to merge 2 commits intov4.xfrom
xingfan-git wants to merge 2 commits intov4.xfrom
Conversation
Contributor
|
@xingfan-git do you have a sample app, which would help me validate the changes? |
swapnil-nagar
requested changes
Mar 30, 2026
Contributor
swapnil-nagar
left a comment
There was a problem hiding this comment.
Sample app to validate this change
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds Node.js SDK support for the Azure Cosmos DB for MongoDB bindings, enabling
developers to trigger functions on MongoDB change stream events and read/write documents
from MongoDB collections using the Azure Functions programming model.
Changes
New Features
app.cosmosDBMongo()— New function registration method for Cosmos DB for MongoDBtriggered functions
trigger.cosmosDBMongo()— New trigger factory for monitoring MongoDB change streams(supports Collection / Database / Cluster level)
input.cosmosDBMongo()— New input binding factory for reading documents from a MongoDBcollection, with optional
queryStringfilter supportoutput.cosmosDBMongo()— New output binding factory for upserting documents into aMongoDB collection
CosmosDBMongoTriggerOptions,CosmosDBMongoTrigger,CosmosDBMongoFunctionOptions,CosmosDBMongoHandler,CosmosDBMongoInputOptions,CosmosDBMongoInput,CosmosDBMongoOutputOptions, andCosmosDBMongoOutputBinding Type Strings
cosmosDBMongoTriggercosmosDBMongocosmosDBMongoTests
Added
test/cosmosDBMongo.test.tswith 12 test cases covering trigger, input, and output —verifying type strings, all binding options, deterministic binding name generation, and
correct
directionvalues viatoCoreFunctionMetadata.