Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
MongoDB が起動時に使用するデータベースを mongorc.js で選択することはできますか?
use dbname
機能していません。これは非 JavaScript マクロです。
db-name は、mongo JavaScript シェルを開始するときのオプションです。
モンゴ モンゴ -- ヘルプ
モンゴ
モンゴ -- ヘルプ
jsファイルからこのようなことを行うこともできます
db = db.getSiblingDB("dbname")