-
-
Notifications
You must be signed in to change notification settings - Fork 595
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
remove id
from object after destroying it
#1454
Comments
Thanks for opening this issue!
|
Can't follow your steps to reproduce. You are logging the obj ID after saving and before destroying. Why do you expect it be undefined? |
Because the object doesn't persist on the database anymore. So there's no record for this ID. So, why should the ID not be undefined? |
I think you have left out the last step in steps to reproduce and added it instead to the "expected / actual outcome". Could you rewrite your example to make clear where you are expecting which outcome? |
Ah, yeah, sure. That wasn't clear. |
I think I understand the issue description now. Could you explain why you expect |
Yeah, that's the point. In my opinien if it's undefined, it never persisted in the database or was deleted. But if the object ID is not undefined that should mean that this object has a record in the database. So here's my question again: When an object is not in the database anymore, why should it have an object ID? |
There are several aspects to consider:
|
New Issue Checklist
Issue Description
I've noticed that when you
destroy
an object, it still has theid
property.Steps to reproduce
Actual Outcome
Expected Outcome
Environment
Server
4.10.6
Ubuntu 20.04
local
Database
MongoDB
5.0.3
local
Client
3.4.1
Logs
The text was updated successfully, but these errors were encountered: