开发者

Updating timestamps in mongoid

开发者 https://www.devze.com 2023-04-06 22:10 出处:网络
How do I update/change the TimestampSequence on a Mongoid document in rails/ruby? If you dont know in Mongoid but know in MongoDB that开发者_如何学编程 will work as well.

How do I update/change the TimestampSequence on a Mongoid document in rails/ruby? If you dont know in Mongoid but know in MongoDB that开发者_如何学编程 will work as well.

The class is Mongoid::TimestampSequence

Thanks in advance


Try this:

  Document.where(somecriteriahere: "criteriavaluehere").update_all(
  updated_at: Time.now.to_s)
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号