Access document's fields without using .get/.set
LennyPenny opened this issue · 3 comments
LennyPenny commented
Is there a plan for this so documents could be used more natively?
i.e.
let user = await User.findOne();
user.name = user.name + " test";
user.save()
I'm not familiar with your current implementation, but it could probably be easily implemented using proxies
vadimdemedes commented
Yes, I think it's ok to implement this now since proxies have good Node.js support now.
LennyPenny commented
vadimdemedes commented
Hm, yeah, I did a little research and I don't think it's possible to implement that feature with a Proxy. Seems there's no clean solution for it. Plus it's not worth all the effort to just save a few chars.