开发者

Updating timestamps in mongoid

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜