@omegup/msync 0.0.68 → 0.0.70

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.esm.js CHANGED
@@ -1019,7 +1019,7 @@ const $unwindDelta = (k1, k2, k, includeNull) => {
1019
1019
  then: {
1020
1020
  $cond: {
1021
1021
  if: { $eq: [`$after.${k2}`, []] },
1022
- then: [],
1022
+ then: [{ before: {}, after: {} }],
1023
1023
  else: [{ before: {}, after: null }],
1024
1024
  },
1025
1025
  },
@@ -1515,10 +1515,10 @@ const getFirstStages = (view) => {
1515
1515
  }));
1516
1516
  const removeNotYetSynchronizedFields = Object.values(mapExactToObject(projection, (_, k) => k.startsWith('_') ? root().of(k).has($exists(true)) : null));
1517
1517
  const hardMatch = $and(pre, ...removeNotYetSynchronizedFields);
1518
- const firstStages = (lastTS) => {
1518
+ const firstStages = (lastTS, keepNulls = false) => {
1519
1519
  const hardQuery = $and(lastTS
1520
1520
  ? root().of('touchedAt').has($gtTs(lastTS.ts))
1521
- : root().of('deletedAt').has($eq(null)), lastTS ? null : match && $expr(match), hardMatch);
1521
+ : root().of('deletedAt').has($eq(null)), lastTS ? null : match && $expr(match), keepNulls ? pre : hardMatch);
1522
1522
  return link()
1523
1523
  .with($match_(hardQuery))
1524
1524
  .with(projectInput);
@@ -1842,7 +1842,7 @@ const executes = (view, input) => {
1842
1842
  const { collection } = view;
1843
1843
  return (finalInput) => {
1844
1844
  const start = input.raw(root);
1845
- const stages = firstStages(null).with(start).with(finalInput).stages;
1845
+ const stages = firstStages(null, true).with(start).with(finalInput).stages;
1846
1846
  return c => c({
1847
1847
  coll: collection,
1848
1848
  input: link().stages,
package/index.js CHANGED
@@ -1021,7 +1021,7 @@ const $unwindDelta = (k1, k2, k, includeNull) => {
1021
1021
  then: {
1022
1022
  $cond: {
1023
1023
  if: { $eq: [`$after.${k2}`, []] },
1024
- then: [],
1024
+ then: [{ before: {}, after: {} }],
1025
1025
  else: [{ before: {}, after: null }],
1026
1026
  },
1027
1027
  },
@@ -1517,10 +1517,10 @@ const getFirstStages = (view) => {
1517
1517
  }));
1518
1518
  const removeNotYetSynchronizedFields = Object.values(mapExactToObject(projection, (_, k) => k.startsWith('_') ? root().of(k).has($exists(true)) : null));
1519
1519
  const hardMatch = $and(pre, ...removeNotYetSynchronizedFields);
1520
- const firstStages = (lastTS) => {
1520
+ const firstStages = (lastTS, keepNulls = false) => {
1521
1521
  const hardQuery = $and(lastTS
1522
1522
  ? root().of('touchedAt').has($gtTs(lastTS.ts))
1523
- : root().of('deletedAt').has($eq(null)), lastTS ? null : match && $expr(match), hardMatch);
1523
+ : root().of('deletedAt').has($eq(null)), lastTS ? null : match && $expr(match), keepNulls ? pre : hardMatch);
1524
1524
  return link()
1525
1525
  .with($match_(hardQuery))
1526
1526
  .with(projectInput);
@@ -1844,7 +1844,7 @@ const executes = (view, input) => {
1844
1844
  const { collection } = view;
1845
1845
  return (finalInput) => {
1846
1846
  const start = input.raw(root);
1847
- const stages = firstStages(null).with(start).with(finalInput).stages;
1847
+ const stages = firstStages(null, true).with(start).with(finalInput).stages;
1848
1848
  return c => c({
1849
1849
  coll: collection,
1850
1850
  input: link().stages,
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "module": "index.esm.js",
4
4
  "typings": "index.d.ts",
5
5
  "name": "@omegup/msync",
6
- "version": "0.0.68",
6
+ "version": "0.0.70",
7
7
  "dependencies": {
8
8
  "dayjs": "^1.11.9",
9
9
  "dotenv": "^16.3.1",