vadimdemedes/mongorito

Access document's fields without using .get/.set

LennyPenny opened this issue · 3 comments

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

Yes, I think it's ok to implement this now since proxies have good Node.js support now.

Sadly I'm having trouble implementing this because I'm not really familiar with the underlying react stuffs

https://vgy.me/dhLqE8.png

Could you point me in the right direction?

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.