MCPcopy Create free account
hub / github.com/IceFireDB/IceFireDB / cmdHEXISTS

Function cmdHEXISTS

hashes.go:93–108  ·  view source on GitHub ↗

HEXISTS key field

(m uhaha.Machine, args []string)

Source from the content-addressed store, hash-verified

91 return redcon.SimpleInt(n), nil
92}
93
94// HEXISTS key field
95func cmdHEXISTS(m uhaha.Machine, args []string) (interface{}, error) {
96 if len(args) != 3 {
97 return nil, uhaha.ErrWrongNumArgs
98 }
99
100 var n int64 = 1
101 v, err := ldb.HGet([]byte(args[1]), []byte(args[2]))
102 if err != nil {
103 return nil, err
104 }
105 if v == nil {
106 n = 0
107 }
108
109 return redcon.SimpleInt(n), nil
110}
111

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected