globalsign / mgo

The MongoDB driver for Go
Other
1.97k stars 231 forks source link

GridFS.OpenId() fails to find files even if ID is valid #337

Closed FM1337 closed 5 years ago

FM1337 commented 5 years ago

Attempting to find a GridFS file using the OpenId function always seems to fail to find the file even though the ID is valid. I have converted it to an ObjectID object, I have tried the ID as a plain string, nothing works.


What version of MongoDB are you using (mongod --version)?

MongoDB 4.0.5 Community

What version of Go are you using (go version)?

go version go1.12 linux/amd64

What operating system and processor architecture are you using (go env)?

GOHOSTARCH="amd64"
GOHOSTOS="linux"

What did you do?

Attempted a lookup of a file in gridfs by Id, it stated the file could not be found, but trying to look up the same file by File name (GridFS().Open()) found the file with no problem.

Can you reproduce the issue on the latest development branch?

Haven't attempted it.

FM1337 commented 5 years ago

You know, it's days like this, that make me want to cry.

There's not a problem, with the library, I just found out that the bson library I was using, wasn't from this one, but rather the unmaintained one. I'm going to go cry now, sorry for wasting your time.