Hello,
I'm using GridFS to store small images (10kb ~ 20kb each), i've stored almost 15k of images, however i got a bad performance when tried to find them with "get_last_version(filename)" from my Document instance.
I'm using Flask, so i've created a view to render images by a given ObjectId, that's pretty fast, the slower process is when i try to get the ObjectId using get_last_version.
I tried to use metadata also (indexed) using the doc's ObjectId, but the query were still slow, so i created a new field at my doc called "image_id", when i save the image in GridFS i also save its ID at the Document, my query is now pretty fast, but i feel that's not the right thing to do...
My question is: Is there another better approach to get file's ids from an Document instead get_last_version or get_version?
(sorry for any english mistakes)