firestore: breaking changes

17 views
Skip to first unread message

Jonathan Amsterdam

unread,
Dec 6, 2017, 8:48:22 AM12/6/17
to google-api-...@googlegroups.com
We've removed the DocumentRef.UpdateMap and DocumentRef.UpdateStruct methods. Their behavior was similar to DocumentRef.Set with a merge option, but different in confusing ways. The previous UpdatePaths method has been renamed to Update.

Change
    docref.UpdateMap(ctx, map[string]interface{}{"a.b", 1})
to
    docref.Update(ctx, []firestore.Update{{Path: "a.b", Value: 1}})

Change
    docref.UpdateStruct(ctx, []string{"Field"}, aStruct)
to
    docref.Update(ctx, []firestore.Update{{Path: "Field", Value: aStruct.Field}})

Reply all
Reply to author
Forward
0 new messages