golang - mgo (mongodb go)如何进行类似shell 的save 或者c#驱动的replace操作?
漂亮男人
漂亮男人 2017-04-28 09:06:20
0
1
736

mgo (mongodb go)如何进行类似shell 的save 或者c#驱动的replace操作?

漂亮男人
漂亮男人

reply all(1)
Ty80

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.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template