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의로 위임된다 : 필드)'... MongoMapper의 쿼리 엔진 인 [plucky] (https://github.com/jnunemaker/plucky/blob/master/lib/plucky/query.rb)에서 [Ruby 드라이버]에 대한 더 많은 추상화를 볼 수 있습니다 (https://github.com/mongodb/mongo-ruby-driver/blob/master/lib/mongo/collection.rb). –