Azure Function with Cosmos MongoDB integration not saving -


i have setup azure function azure cosmos db(document) output. cosmos database configured mongodb. , added following simple code try , add new document:

module.exports = function (context, eventhubmessages) {    context.bindings.document = {    text : "test data" }    context.done(); }; 

when test run success, when try open the collection using studio 3t get:

query failed error code 1 , error message 'unknown server error occurred when processing request.' 

when use same code write documentdb success , can view data in azure. need use different api save data mongodb?

the documentdb output binding using documentdb api connect , save information in database. database (from saying) using mongodb api, different apis (links point docs).

as surely know, mongodb has requirements (like existence of "_id" attribute) covered when connect database mongodb client (either sdk or third-party client), since communicating through documentdb api, it's failing fulfill requirements.

you might want try , use mongo driver in function connect cosmos db database through mongodb api.


Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -