0
mongo mapperでカプセル化されていないmongo mapperとrunコマンドから接続を取得するためのベストプラクティスは何ですか?mongo mapperを使用しているときに複雑なコマンドを実行する
mongo mapperでカプセル化されていないmongo mapperとrunコマンドから接続を取得するためのベストプラクティスは何ですか?mongo mapperを使用しているときに複雑なコマンドを実行する
試してみてください。
MongoMapper.database
# or
MyModel.collection
が次にあなたがすることができるもののためMongo Ruby driverに見えます。 MongoMapperはatomic modifiersをサポートし、あなたがdistinct
クエリを実行できることを
注:
MyModel.query.distinct(:field)
'あなたは今(' MyModel.distinctを行うことができますので、distinct'などが正しく、MongoMapper 0.11.1のよう委任されています。フィールド) '... [Rubyドライバ]の抽象度については、MongoMapperのクエリエンジン[plucky](https://github.com/jnunemaker/plucky/blob/master/lib/plucky/query.rb)を参照してください( https://github.com/mongodb/mongo-ruby-driver/blob/master/lib/mongo/collection.rb)。 –