Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[3.0.0-beta.6] fileObj._id on upload end ? #889

Open
ddaydd opened this issue May 6, 2024 · 7 comments
Open

[3.0.0-beta.6] fileObj._id on upload end ? #889

ddaydd opened this issue May 6, 2024 · 7 comments

Comments

@ddaydd
Copy link

ddaydd commented May 6, 2024

Hello,

with the 3.0.0-beta.6 version, how to retrieve the id?

      upload.on('end', function (error, fileObj) {
          console.log(fileObj._id); // undefined
    }

Thanks.

@dr-dimitru
Copy link
Member

@bratelefant @jankapunkt @harryadel do we have bug in beta/rc release?

@dr-dimitru
Copy link
Member

@ddaydd have you found a solution?

@ddaydd
Copy link
Author

ddaydd commented Jun 25, 2024

no, and I saw that findOne became findOneAsync but no insertAsync?

@dr-dimitru
Copy link
Member

dr-dimitru commented Jun 25, 2024

@ddaydd .insert is client only and only mimics .insert method of mongodb driver

@ddaydd
Copy link
Author

ddaydd commented Jun 26, 2024

thank you for motivating me...
I found the _id

...
let fileId;
upload.on('start', function () {
  fileId = this.config.fileId
});
...

@dr-dimitru
Copy link
Member

@ddaydd I'm sure it's available via this inside end event as well

@ddaydd
Copy link
Author

ddaydd commented Jul 1, 2024

Yes, i confirm, but I leave it open, this must at least be changed or documented. thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants