ruby on rails - Mongoid pluck function not working as expected on subdocuments -


i have mongo shell query working , im trying duplicate mongoid.
here works in mongo shell

db.getcollection('accounts').find({field1: 'test'}, {'field1': 1, 'subdocs.field2': 1})    

according this answer, pluck method should work, returns nil subdocs.field2 though there value in document.

>>account.where(field1: 'test').pluck(:field1, 'subdocs.field2') [['test', nil], ['test', nil]] 

does know i'm doing wrong?


Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - .htaccess mod_rewrite for dynamic url which has domain names -

Website Login Issue developed in magento -