How to find the exact version of installed MongoDB

后端 未结 5 1778
独厮守ぢ
独厮守ぢ 2021-01-31 01:04

I have mongoDB 3.2 installed locally for Windows 7. I would like to find out its specific version (like is it 3.2.1, or 3.2.3 or...). How could I find it? If I open the database

5条回答
  •  囚心锁ツ
    2021-01-31 01:12

    From the Java API:

    Document result = mongoDatabase.runCommand(new Document("buildInfo", 1));
    String version = (String) result.get("version");
    List versionArray = (List) result.get("versionArray");
    

提交回复
热议问题