You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I want to update specifically one property inside the metadata object without replacing the whole object, I can do it by creating an atomic update object like this:
constuserId=db.users.id('my-id);
// This works, but does not compileawaitdb.users.update(userId,{"metadata.nestedKey1": 123});
It currently works fine, even using Typesaurus. However, the UpdateData type does not support it so it result in a compilation error.
I don't know if the best way would be to update the UpdateData type or to create a dedicated type but if you point me the right way to do it, I would be happy to submit a PR.
The text was updated successfully, but these errors were encountered:
Hey!
Thanks for this awesome library.
In the current version it seems it's not possible to update nested objects atomically.
Here is an example to illustrate what I mean.
Given the following schema:
If I want to update specifically one property inside the metadata object without replacing the whole object, I can do it by creating an atomic update object like this:
It currently works fine, even using Typesaurus. However, the
UpdateData
type does not support it so it result in a compilation error.I don't know if the best way would be to update the
UpdateData
type or to create a dedicated type but if you point me the right way to do it, I would be happy to submit a PR.The text was updated successfully, but these errors were encountered: