0
我有這樣
$ db.histories.aggregate([{$match:{"issue_id":{$in:ids},"history_comment":{$exists:true,$not:{$size:0}}}},{$unwind:"$history_comment"}])
翻譯這go
使用mgo
var h []History
query := []bson.M{
{"$match": bson.M{
"issue_id": bson.M{"$in": IDs},
"history_comment": bson.M{"$exists": true, "$not": bson.M{"$size": 0}}}},
{"$unwind": "$history_comment"},
}
err := c.Pipe(query).All(&h)
彙總查詢,但我收到了err
Unknown element kind (0x2E)
這怎麼可能?我的查詢錯誤?
雖然bson試圖解碼您的數據,但它無法識別「種類」的數據。錯誤來自(d *解碼器)readElemTo函數在http://bazaar.launchpad.net/+branch/mgo/v1/view/head:/bson/decode.go中。您的數據似乎與任何bson類型都不兼容。 –