-
Hi, I'm trying to use getters, setters and watch to create a combination of calculated an virtual attributes. I have the three attributes However, when reading an entity I'd like to merge these three attributes into one object attribute Example: await tasks
.patch({ id: "1" })
// this should set the values on contexId, contextType and contextUrl
.set({ context: { id: "1", type: "product", url: "https://example.com" } })
.go();
// result should contain context without contexId, contextType and contextUrl
const result = tasks.get({ id }).go(); Currently, |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Hi @zirkelc Ultimately |
Beta Was this translation helpful? Give feedback.
Hi @zirkelc
Ultimately
watch
is more to help with some basic/common denormalization patterns, and less to perform object transformation. For those types of transformations, which I think this is one of those, it's ultimately left to the user to create the end-state objects they need. ElectroDB acts maybe less like an ORM and more like query builder in this regard.