As we know, we can use ObjectId as our identifier. In my situation I have legacy code where we use GUIDs in MongoDB (UUID) as identifiers.
Best Practices for UUID Data in MongoDB
I have a problem with getting a file from GridFS by UUID.
I use new MongoDB.Driver.GridFS package and use GridFSBucket class.
I would like to get stream by UUID not ObjectId but I can see that all overloads of DownloadToStream(XXX) methods have take ObjectId as parameter. There is no overload for UUID.
So, the question is: Is there any way to convert safely UUID to ObjectId and try to get the file from MongoDB?
Any help will be appreciated.
Adam