func (c *C) SaveFulltext(a iface.Filter) error { doc, err := a.FindOne() if err != nil { return err } upd := c.updateFromDoc(doc) return a.Update(upd) }
func (c *C) Edit(a iface.Filter) ([]map[string]interface{}, error) { doc, err := a.FindOne() if err != nil { return nil, err } scheme, err := c.getScheme(a.Subject(), "Update") if err != nil { return nil, err } return convert.SchemeToFields(scheme, doc) }
func (c *C) Edit(a iface.Filter) (string, error) { doc, err := a.FindOne() if err != nil { return "", err } for _, v := range ignore { delete(doc, v) } marsh, err := json.MarshalIndent(doc, "", "\t") if err != nil { return "", err } return string(marsh), nil }
func (b *Basics) GetSingle(a iface.Filter) (map[string]interface{}, error) { return a.FindOne() }