This is a kind of stupid syntax error, tried many ways, just could not get it to work, someone, please help.
MongoDB in Go with mgo, I just tried to simplify the use of the operator $ne, as shown below, but continued to receive a compilation syntax error:
line 15: convIter := Session.Copy().DB("").C("convs").Find(bson.M {
line 16: "conversationStatus": interface{} {
line 17: bson.M {
line 18: "$ne": "DESTROYED"
line 19: },
line 20: },
line 21: }).Iter()
I tried to add a comma to ,remove the comma everywhere, I just couldn’t make it work, I always got such a syntax error compilation as shown below:
mongodb/query.go:16: syntax error: unexpected {, expecting comma or }
mongodb/query.go:20: syntax error: unexpected }, expecting expression
mongodb/query.go:21: syntax error: unexpected }, expecting expression
source
share