question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Does document.remove actually return the removed doc?

See original GitHub issue

The documentation suggests that docInstance.remove() takes a callback and passes err, document, but that doesn’t seem to actually work:

https://github.com/LearnBoost/mongoose/blob/049288f7b2f2cc0fb4a4a275c7e801304df93938/lib/model.js#L550

remove() calls back with no second argument, even when a document has been removed. It would be nice if the removed document were passed back as in the example, but if not then the documentation should at least be updated with the real behavior.

Issue Analytics

  • State:closed
  • Created 10 years ago
  • Comments:12 (2 by maintainers)

github_iconTop GitHub Comments

8reactions
vkarpov15commented, Feb 20, 2017

@stieg findOneAndRemove() should return the removed doc, if any. If this isn’t working for you please open up a new issue with code samples.

0reactions
stiegcommented, Feb 21, 2017

@stieg findOneAndRemove() should return the removed doc, if any. If this isn’t working for you please open up a new issue with code samples.

Will do.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Delete and restore deleted files - Microsoft Support
If you want all of your files back, select Restore all items. Or, select only the files you want and click Restore. The...
Read more >
5 Ways to Recover Permanently Deleted Word Document (Free)
Yes, your Word files can be recovered easily if you choose the tool that best fits your requirements. There are also specific steps...
Read more >
Remove Hidden Data in Microsoft Word | IT Services
Click the File tab to return to your document and changes you made will be saved automatically. Hide revisions or comments. Remove all...
Read more >
How to Recover Unsaved/Deleted Word Document in 2022
Restore the deleted document and either find it in its original location or click Quick Access to find it in the Recent Files...
Read more >
How do I remove files or recover an item that I removed?
If you "remove" an item that has been Shared with you, it will not remove the original from the owner's Google Drive. The...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found