2012-03-09 1 views

답변

1

시도 :

MongoMapper.database 
# or 
MyModel.collection 

그런 다음 당신이 할 수있는 것들을하여 Mongo Ruby driver로 본다. MongoMapper가 atomic modifiers을 지원하고 당신이 distinct 쿼리를 실행할 수

참고 :

MyModel.query.distinct(:field) 
+0

'당신은 지금 ('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). –