Closed makew0rld closed 4 years ago
You don't have to load the object in memory to delete it, you can use DeleteStruct
like this:
db.DeleteStruct(&Foo{ID: 1})
Okay, that's exactly what I was planning on doing. Thanks! It'd be helpful to have this on the README maybe.
It'd be helpful to be able to delete objects without having load the whole object into memory. If I just have the ID of an object, can I delete it just based on that, or does
DeleteStruct
look at more? I was planning on creating an dummy object where only the ID is set, and then sending that toDeleteStruct
.