MCPcopy Create free account
hub / github.com/GetStream/stream-go2 / Update

Method Update

collections.go:108–118  ·  view source on GitHub ↗

Update updates the given collection object's data.

(ctx context.Context, collection, id string, data map[string]any)

Source from the content-addressed store, hash-verified

106
107// Update updates the given collection object's data.
108func (c *CollectionsClient) Update(ctx context.Context, collection, id string, data map[string]any) (*CollectionObjectResponse, error) {
109 if collection == "" {
110 return nil, errors.New("collection name required")
111 }
112 endpoint := c.client.makeEndpoint("collections/%s/%s/", collection, id)
113 reqData := map[string]any{
114 "data": data,
115 }
116
117 return c.decodeObject(c.client.put(ctx, endpoint, reqData, c.client.authenticator.collectionsAuth))
118}
119
120// Delete removes from a collection the object having the given ID.
121func (c *CollectionsClient) Delete(ctx context.Context, collection, id string) (*BaseResponse, error) {

Callers

nothing calls this directly

Calls 3

decodeObjectMethod · 0.95
makeEndpointMethod · 0.80
putMethod · 0.80

Tested by

no test coverage detected