I am trying to get back the _id
of a document that has been streamed to MongoDB via GridFS. Is there a way to do this?
The code is very simple. I am running the following to insert the document into MongoDB:
readableStream.pipe(bucket.openUploadStream('myFile.pdf');
Looking for a way to get the _id back from this stream - if anyone knows a way to do this please advise.