mgo $unwind aggregation result to Unknown element kind (0x2E)

49 views
Skip to first unread message

jeane paul Soliva

unread,
Sep 22, 2015, 8:17:58 AM9/22/15
to mgo-users


I have an aggregate query like this

`$ db.histories.aggregate([{$match:{"issue_id":{$in:ids},"history_comment":{$exists:true,$not:{$size:0}}}},{$unwind:"$history_comment"}])`

translating this to `go` using `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)

but I received an `err`
 
`Unknown element kind (0x2E)`
how is this possible? is my query wrong? really appreciate any help. 

Faisal KK

unread,
Sep 23, 2015, 1:28:03 AM9/23/15
to mgo-users
Hi ,

I have given comment in StackOF.

It seems like your data can't be decoded by bson function.

Could you give some details of data you are trying to aggregate ?

Regards,
Faisla K K

Gustavo Niemeyer

unread,
Oct 14, 2015, 11:09:27 AM10/14/15
to mgo-...@googlegroups.com
As Faisal and the errors itself points out, the data being handed to the driver has an unknown element kind.

If you look at the BSON specification, there's no 0x2E in there:


If you think this is an issue in the driver, can you please provide a dump of the offending data that can be loaded into the driver, and open an issue with it?

Thanks,



--
You received this message because you are subscribed to the Google Groups "mgo-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mgo-users+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Reply all
Reply to author
Forward
0 new messages