mgo (mongodb go)如何进行类似shell 的save 或者c#驱动的replace操作?
PHP中文网2017-04-28 09:08:20
I have solved it myself
See [httpmongo]https://github.com/golangframework/httpmongo/blob/master/collection.go for details
Mongodb provides a method of complete replacement based on _id
I used the method of remove first, then insert to implement the save operation, which also ensures that data that meets the filter conditions will not be repeated multiple times.