Soft delete in mgo ?

blov · 2016-05-17 13:31:12 · 785 次点击    
这是一个分享于 2016-05-17 13:31:12 的资源,其中的信息可能已经有所发展或是发生改变。

Hi. Is there any clean way to implement soft delete in mgo like the one in "gorm" ? I can add the detetedAt field myself and also update it myself, but I couldn't find any clean way to scope "all" the queries to make sure that deletedAt is not nil. So is there any way to do it? Thank you.


评论:

SerialMiller:

AFAIK mgo is a driver, nothing more nothing less. Guess you're responsible yourself for implementing stuff as soft-deletes etc.


入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889

785 次点击  
加入收藏 微博
0 回复
暂无回复
添加一条新回复 (您需要 登录 后才能回复 没有账号 ?)
  • 请尽量让自己的回复能够对别人有帮助
  • 支持 Markdown 格式, **粗体**、~~删除线~~、`单行代码`
  • 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
  • 图片支持拖拽、截图粘贴等方式上传