How to find the exact version of installed MongoDB



  • 3 Answer(s)

    Just try to do this one:

    db.version()
    
    

    To Refer https://docs.mongodb.com/manual/reference/method/db.version/

     

     

    Answered on January 11, 2019.
    Add Comment

    Choice 1:

    To begin the console and execute this:

    db.version()
    

    Choice 2:

    To open a shell console and do:

    $ mongod --version
    

    To show like this one:

    $ mongod --version
    db version v3.0.2
    
    Answered on January 11, 2019.
    Add Comment

    For that Java API:

    Document result = mongoDatabase.runCommand(new Document("buildInfo", 1));
    String version = (String) result.get("version");
    List<Integer> versionArray = (List<Integer>) result.get("versionArray");
    
    Answered on January 11, 2019.
    Add Comment


  • Your Answer

    By posting your answer, you agree to the privacy policy and terms of service.