MongoDB
 Computer >> コンピューター >  >> プログラミング >> MongoDB

データベースのMongoDBが64ビットかどうかを知るにはどうすればよいですか?


runCommandと一緒にbuidInfoを使用して、MongoDBの32ビットまたは64ビットをチェックできます。まず、データベースを管理者に切り替えます。構文は次のとおりです

use admin

その後、次の構文を使用して、サーバーがMongoDB64ビットを実行しているかどうかを確認します

db.runCommand(buildInfo)

上記の構文を実行します

> use admin
switched to db admin
> db.runCommand("buildInfo");
を使用します

以下は、MongoDBが64ビットであることを示す出力です

{
   "version" : "4.0.5",
   "gitVersion" : "3739429dd92b92d1b0ab120911a23d50bf03c412",
   "targetMinOS" : "Windows 7/Windows Server 2008 R2",
   "modules" : [ ],
   "allocator" : "tcmalloc",
   "javascriptEngine" : "mozjs",
   "sysInfo" : "deprecated",
   "versionArray" : [
      4,
      0,
      5,
      0
   ],
   "openssl" : {
      "running" : "Windows SChannel"
   },
   "buildEnvironment" : {
      "distmod" : "2008plus-ssl",
      "distarch" : "x86_64",
      "cc" : "cl: Microsoft (R) C/C++ Optimizing Compiler Version 19.00.24223 for x64",
      "ccflags" : "/nologo /EHsc /W3 /wd4355 /wd4800 /wd4267 /wd4244 /wd4290
      /wd4068 /wd4351 /wd4373 /we4013 /we4099 /we4930 /WX /errorReport:none /MD /O2 /Oy- /bigobj           /utf-8 /Zc:rvalueCast /Zc:strictStrings /volatile:iso /Gw /Gy /Zc:inline",
      "cxx" : "cl: Microsoft (R) C/C++ Optimizing Compiler Version 19.00.24223 for x64",
      "cxxflags" : "/TP",
      "linkflags" : "/nologo /DEBUG /INCREMENTAL:NO /LARGEADDRESSAWARE /OPT:REF",
      "target_arch" : "x86_64",
      "target_os" : "windows"
   },
   "bits" : 64,
   "debug" : false,
   "maxBsonObjectSize" : 16777216,
   "storageEngines" : [
      "devnull",
      "ephemeralForTest",
      "mmapv1",
      "wiredTiger"
   ],
   "ok" : 1
}

  1. MongoDB Java環境をセットアップする方法は?

    MongoDBのインストールと実行 MongoDBホームページにアクセスし、[ソフトウェア](ドロップダウン)で[コミュニティサーバー]を選択します。 MongoDB Community Serverページで、プラットフォームの詳細を指定し、プラットフォームと互換性のあるMongoDBサーバーをダウンロードします。 ダウンロードしたソフトウェアをインストールし、データベースファイルを保存するためにCドライブにdataという名前のフォルダ/ディレクトリを作成します。 コマンドプロンプトを開き、 mongodを実行してMongoDBサーバーを実行します 以下に示

  2. Javaを使用してMongoDBにデータベースをドロップする方法は?

    MongoDB db.dropDatabase() コマンドを使用して既存のデータベースを削除します。これにより、現在のデータベースが削除されます。何も選択していない場合は、デフォルトの(テスト)データベースが削除されます。 構文 db.dropDatabase() Javaでデータベースを削除するには、まず、 getDatabase()を使用して必要なデータベースのオブジェクトを取得します。 メソッドを作成し、drop()メソッドを呼び出して削除します。 例 import com.mongodb.MongoClient; import com.mongodb.client.MongoDa