It is kind of stupid syntax error, tried tons of ways, just couldn't get it work, someone please help.
MongoDB in Go with mgo
, I just tried to simplify use the $ne
operator, code like below, but kept getting compile 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()
Tried to add comma ,
remove comma everywhere, just couldn't get it work, always got such compile syntax error like 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