如何在mongoid中更新一个属性

时间:2017-11-08 10:40:32

标签: ruby-on-rails mongodb mongoid

如何仅更新:share_count,也许应该使用var stockEvaluation = (from ib in mapicsSession.Query<ItemBalance>() orderby w.Description group ib by w.Description into g select new { g.Key, }).Except(sysproWarehouses); 来完成? 我在rails和mongoid上使用ruby

upsert

1 个答案:

答案 0 :(得分:1)

count = SocialShares.total url, %w(sharedcount)
update_attributes share_count: count