1
私はmongodbコレクション内のリソースをすべて検索しようとしています。mongo find()はevalで出力を生成しません
私はカウントOKを取得することができます。
mongo ip:port/database1 -u correctusername -p correctpassword
--authenticationDatabase admin --eval "db.getCollection('collection_123').count()"
しかし、私はそれを微調整しようとすると、
mongo ip:port/database1 -u correctusername -p correctpassword
--authenticationDatabase admin --eval "db.getCollection('collection_123').find()"
をそれは私もfind({})
を試してみました
MongoDB shell version: 2.4.0
connecting to: ip:port/database1
DBQuery: database1.collection_123 -> { }
を生成ザ認証エラーではないようです。最初のクエリが機能し、カウントが生成されます。私はまた、
mongo ip:port/database1 -u correctusername -p correctpassword
--authenticationDatabase admin
モンゴシェルと
db.getCollection('collection_123').find()
に取得し、正しいJSON出力を見ることができます。
ケアのですか?これは本当にテーブル123ですか? – Oct
@Octコレクションに更新しました。単なるテストコレクションです。 – Michael