MCPcopy Create free account
hub / github.com/MG-RAST/Shock / dbUpsert

Function dbUpsert

shock-server/node/db.go:61–67  ·  view source on GitHub ↗
(n *Node)

Source from the content-addressed store, hash-verified

59}
60
61func dbUpsert(n *Node) (err error) {
62 session := db.Connection.Session.Copy()
63 defer session.Close()
64 c := session.DB(conf.MONGODB_DATABASE).C("Nodes")
65 _, err = c.Upsert(bson.M{"id": n.Id}, &n)
66 return
67}
68
69func dbFind(q bson.M, results *Nodes, order string, options map[string]int) (count int, err error) {
70 session := db.Connection.Session.Copy()

Callers 2

SaveMethod · 0.85
ReloadFromDiskFunction · 0.85

Calls 1

CloseMethod · 0.65

Tested by

no test coverage detected