本文整理汇总了Golang中github.com/opesun/nocrud/frame/interfaces.Document.Update方法的典型用法代码示例。如果您正苦于以下问题:Golang Document.Update方法的具体用法?Golang Document.Update怎么用?Golang Document.Update使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/opesun/nocrud/frame/interfaces.Document
的用法示例。
在下文中一共展示了Document.Update方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: Uninstall
func (e *Entries) Uninstall(o iface.Document, resource string) error {
upd := map[string]interface{}{
"$pull": map[string]interface{}{
"Hooks." + resource + "TopModFilter": []interface{}{"meeting.entries", "TopModFilter"},
},
}
return o.Update(upd)
}
示例2: Uninstall
func (c *C) Uninstall(o iface.Document, resource string) error {
upd := map[string]interface{}{
"$pull": map[string]interface{}{
"Hooks.fkidTypeHandler": "fkid",
},
}
return o.Update(upd)
}
示例3: Uninstall
func (C *C) Uninstall(o iface.Document, resource string) error {
upd := map[string]interface{}{
"$set": map[string]interface{}{
"nouns." + resource + ".verbs.Execute.input": 1,
},
}
return o.Update(upd)
}
示例4: Uninstall
func (c *C) Uninstall(o iface.Document, s string) error {
upd := map[string]interface{}{
"$pull": map[string]interface{}{
fmt.Sprintf("Hooks.%vInserted", s): []interface{}{"fulltext", "SaveFulltext"},
fmt.Sprintf("Hooks.%vUpdated", s): []interface{}{"fulltext", "SaveFulltext"},
"Hooks.ProcessQuery": "fulltext",
},
}
return o.Update(upd)
}
示例5: Uninstall
func (c *C) Uninstall(o iface.Document, resource string) error {
upd := map[string]interface{}{
"$pull": map[string]interface{}{
"Hooks.SanitizerMangler": "file",
"Hooks.fileTypeHandler": []interface{}{
"file",
"FileTypeHandler",
},
},
}
return o.Update(upd)
}
示例6: Install
func (tt *TimeTable) Install(o iface.Document, resource string) error {
upd := map[string]interface{}{
"$addToSet": map[string]interface{}{
"Hooks." + resource + "TopModFilter": []interface{}{"meeting.timeTable", "TopModFilter"},
"Hooks.AddTemplateBuiltin": []interface{}{"meeting.timeTable"},
},
"$set": map[string]interface{}{
"nouns." + resource + ".verbs.Save.input": map[string]interface{}{
"timeTable": map[string]interface{}{
"type": "any",
"slice": true,
"must": true,
},
},
},
}
return o.Update(upd)
}