mirror of
https://github.com/tengge1/ShadowEditor.git
synced 2026-01-18 15:02:09 +00:00
21 lines
248 B
Go
21 lines
248 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"go.mongodb.org/mongo-driver/bson"
|
|
)
|
|
|
|
func main() {
|
|
set := bson.M{
|
|
"foo": "bar",
|
|
}
|
|
update := bson.M{
|
|
"$set": set,
|
|
}
|
|
set["hello"] = "world"
|
|
|
|
result := update["$set"].(bson.M)
|
|
fmt.Println(result["hello"])
|
|
}
|