-
Notifications
You must be signed in to change notification settings - Fork 78
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
Choosing an alternate/custom EntityId
field (or at the very least, exposing it by default).
#194
Comments
I've been noodling on this a bit as the restructuring is a bit of a hassle. For now, that's the best way. When I was putting this together, I first thought I would just store the entityId as a field named I still want to stick with the Symbols as I think that utility is there. But I'm also thinking that maybe I could add a configuration option to the Schema to map the Entity symbol to a named property of your choice. And if that option isn't specified, then just default to current behavior. I'm gonna mark this as a new feature and see about adding it in the near future. |
This would be helpful: Thanks very much for your work on the project @guyroyse |
I'm missing the ability to specify ID as a field. As is done in Redis om python.
This way I can easily use the keys that I already have in my database. |
Hi there, Thanks! |
So, I've seen the following two posts concerning
EntityId
customization:https://github.com/redis/redis-om-node/issues/186
https://github.com/redis/redis-om-node/issues/40
However, I'm actually interested in selecting the field-name to which the value gets assigned, and revealing it (via
toJSON()
, or whatever else) for use with CRUD/REST functionality . As it stands, I currently destructure ({...myObj, id: myObj[EntityId]}
) or use some version ofReflect.ownKeys(myObj)
every time I need it. Would be nice to just have it "built-in" and available when the object is CRUDed.I'm almost certain I'm missing something obvious in the documentation. 🤔
The text was updated successfully, but these errors were encountered: