copydb
mongodbでコマンドを使おうとしています。
そうすると、次の例外が発生します。
Command 'copydb' failed: access denied; use admin db (response: { "errmsg" : "access denied; use
admin db", "ok" : 0.0 })
管理者としてログインしようとしましたが、ユーザー名とパスワードを使用していないため失敗しました。
ユーザー名とパスワードなしで管理者としてログインするにはどうすればよいですか?すでに権限を持っているのに、なぜ管理者としてログインする必要があるのdrop
ですか?
前もって感謝します
m_mongoDatabase.RunCommand(new CommandDocument(new BsonElement("copydb", (BsonValue) 1),
new BsonElement("fromdb", (BsonValue) from),
new BsonElement("fromhost", (BsonValue) fromHost),
new BsonElement("todb", (BsonValue) to)));