-
Type: Task
-
Resolution: Done
-
Priority: Minor - P4
-
Affects Version/s: None
-
Component/s: None
-
None
This is possibly related to MONGOID-3020 - the only difference is that the targeted document persists with the same ID.
I'm not using a replica set - this is happening on my local machine in my test and development environments. Whenever I try to destroy an embedded document, the object appears to be deleted in memory, but persists in the database.
(rdb:1) p record.terminals [ #<ControlCenter::Terminal _id: 51a904dfba0810d1ee000016, created_at: 2013-05-31 20:15:27 UTC, updated_at: 2013-05-31 20:15:27 UTC, ... >, #<ControlCenter::Terminal _id: 51a904dfba0810d1ee000017, created_at: 2013-05-31 20:15:27 UTC, updated_at: 2013-05-31 20:15:27 UTC, ... > ] (rdb:1) p record.terminals.last.destroy true (rdb:1) p record.terminals [ #<ControlCenter::Terminal _id: 51a904dfba0810d1ee000016, created_at: 2013-05-31 20:15:27 UTC, updated_at: 2013-05-31 20:15:27 UTC, ... > ] (rdb:1) p record.reload.terminals [ #<ControlCenter::Terminal _id: 51a904dfba0810d1ee000016, created_at: 2013-05-31 20:15:27 UTC, updated_at: 2013-05-31 20:15:27 UTC, ... >, #<ControlCenter::Terminal _id: 51a904dfba0810d1ee000017, created_at: 2013-05-31 20:15:27 UTC, updated_at: 2013-05-31 20:15:27 UTC, ... > ]
My Moped logs show what appears to be a reasonable deletion query:
MOPED: 127.0.0.1:17017 UPDATE database=test collection=control_center_records selector={"_id"=>"51a904dfba0810d1ee000015"} update={"$pull"=>{"terminals"=>{"_id"=>"51a904dfba0810d1ee000017"}}} flags=[] (0.2589ms)
I'm not exactly sure what's happening here. Why would my object get deleted in memory, but not in the database?
- is duplicated by
-
MONGOID-3020 Deleted embedded object reappears with different _id
- Closed