panic reading index
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
mgo |
New
|
Undecided
|
Unassigned |
Bug Description
Hi All,
I'm getting a panic reading an index using mgo, go1.1, on a recent osx.
when I add an index via the mongo cli as follows,
pantstastic:
pantstastic:
[
{
"v" : 1,
"key" : {
"_id" : 1
},
"ns" : "test.foo",
"name" : "_id_"
},
{
"v" : 1,
"key" : {
"whoop" : 1
},
"ns" : "test.foo",
"name" : "whoop_1"
}
]
and then read the index by:
indexes, err := sess.DB(
I get a panic: Got unknown index key type for field whoop
It seems that for some reason, the function simpleIndexKey in mgo's session.go expects the key to have a value that's either an integer or a string. on my system, realKey[i].Value seems to think that it's a float64