-
Notifications
You must be signed in to change notification settings - Fork 23
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
[R] fix (x-bundle): add deepsync to the inseret/update executors #281
base: main
Are you sure you want to change the base?
Conversation
I don’t understand how you changes are allowing the executor to deepsync the inpu. All it does is Fetch the inserted / updated doc and deepsync it, which will have no effect (unless you inserting fields in the root document, which is undesirable) |
d70b1b8
to
a5ccae5
Compare
@@ -155,6 +156,7 @@ export function CheckDocumentExists<T>( | |||
*/ | |||
export function ToDocumentInsert<T>( | |||
collectionClass: Constructor<Collection<T>>, | |||
options?: InsertUpdateExecutorOptions, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This introduces breaking changes. Let's use either field, or { field: "xxx", deepSync: "xxx" })
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
extend() I don't think it's ever used. But add it to those options, so it's a string (field) or an object of options.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check comments
if (typeof options.deepSync !== "boolean") { | ||
const deepSyncFields = {}; | ||
(Array.isArray(options.deepSync) | ||
? options.deepSync |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So we are specifying which fields we're going to deep sync? How does this help us, since document[key] already exists and then you merge it below, won't it be like that everytime?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For now only allow deepSync as bool.
…/x-bundle/260-deepsync-in-executors
close #260