[go-nuts] Go and Mongodb partial update

2019-12-04 Thread Gabriele Bassi
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 collection
https://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 is
https://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.
[image: jsoneditoronline.org]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.
[image: jsoneditoronline.org]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.

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

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/f08cab2f-3bef-4d14-9a77-26c2cbb35107%40googlegroups.com.


[go-nuts] Re: Go and Mongodb partial update

2020-01-03 Thread Gabriele Bassi


Il giorno mercoledì 4 dicembre 2019 14:48:57 UTC+1, Gabriele Bassi ha 
scritto:
>
> 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 collection
> https://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 is
> https://jsoneditoronline.org/?id=81f6bbd30bab4349964d692fc3b374ee
> *jsoneditoronline.org <http://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 <http://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.
> [image: jsoneditoronline.org]jsoneditoronline.org
> JSON Editor Online - view, edit and format JSON online 
> <https://jsoneditoronline.org/?id=5d1cb75ba2de4626ab2a4628e29b955e>
> 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.
> [image: jsoneditoronline.org]jsoneditoronline.org
> JSON Editor Online - view, edit and format JSON online 
> <https://jsoneditoronline.org/?id=81f6bbd30bab4349964d692fc3b374ee>
> 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.
>
>
Golang play sample:

https://play.golang.org/p/CigD_a_XC2Y 

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/037a7bbf-0054-40c3-9c2c-e49e3bb917a3%40googlegroups.com.