Cosmos with mongodb (vcore) in a golang environment?

Johan Westerlund 21 Reputation points
2025-06-11T13:40:31.31+00:00

Hi our team here at Solidicon has trouble understanding what client to use in a golang environment when using Cosmos with mongodb (vcore) version, we hear and read different answers. we hear that the official "mongo-driver" works fine but then we get trouble with azure when cosmos deside to change master node since mongo-driver cannot handle switching of write node when that happends. what is the recommended way to work with Cosmos with mongodb (vcore) in a golang environment?

Azure Cosmos DB
Azure Cosmos DB
An Azure NoSQL database service for app development.
1,902 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Oury Ba-MSFT 20,911 Reputation points Microsoft Employee Moderator
    2025-06-23T20:30:15.7266667+00:00

    @Johan Westerlund Thank you for reaching out.

    In mongo vcore you always have one primary node, optional HA, and optional cross-region replicas. The Mongo drivers are the way to go. 

    Mongo vCore is an OSS Mongo compatible database. It's a managed version of OSS DocumentDB: DocumentDB: Open-Source Announcement - Microsoft Open Source Blog

    I am not sure we are missing something up. I would like to get more details on the issue you're facing with Mongo DB.

    Regards,

    Oury


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.