Go and Mongodb partial update

339 views
Skip to first unread message

Gabriele Bassi

unread,
Dec 4, 2019, 8:48:57 AM12/4/19
to golang-nuts
Hi to allI have some trouble with golang and mongoDB i'm using the official mongodb driver for go.What i have to do is manage partial mongo db update casting a map[string]interface{} to a bison.M to perform an update.I have following collectionhttps://jsoneditoronline.org/?id=5d1cb75ba2de4626ab2a4628e29b955eThe request body of update post can contains one or more properties of the collection.How i can cast body request to a valid bison.M to per form the update?For example if update dto ishttps://jsoneditoronline.org/?id=81f6bbd30bab4349964d692fc3b374ee
jsoneditoronline.org
JSON Editor Online - view, edit and format JSON online
JSON Editor Online is a web-based tool to view, edit, and format JSON. It shows your data side by side in a clear, editable treeview and in a code editor.jsoneditoronline.org
JSON Editor Online - view, edit and format JSON online
JSON Editor Online is a web-based tool to view, edit, and format JSON. It shows your data side by side in a clear, editable treeview and in a code editor.
JSON Editor Online is a web-based tool to view, edit, and format JSON. It shows your data side by side in a clear, editable treeview and in a code editor.
JSON Editor Online is a web-based tool to view, edit, and format JSON. It shows your data side by side in a clear, editable treeview and in a code editor.

how i can perform and update or and insert without deleting old data?

Gabriele Bassi

unread,
Jan 3, 2020, 12:51:00 PM1/3/20
to golang-nuts
Reply all
Reply to author
Forward
0 new messages