@mongoosejs/studio 0.1.16 → 0.1.17

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.
@@ -41,6 +41,9 @@ module.exports = ({ db }) => async function updateDocument(params) {
41
41
  } else if (value === 'undefined') {
42
42
  // Use $unset to remove the field for undefined values
43
43
  unsetFields[key] = 1;
44
+ } else if (value === '') {
45
+ // Treat empty strings as undefined - unset the field
46
+ unsetFields[key] = 1;
44
47
  } else {
45
48
  setFields[key] = value;
46
49
  }
@@ -41,6 +41,9 @@ module.exports = ({ db }) => async function updateDocuments(params) {
41
41
  } else if (value === 'undefined') {
42
42
  // Use $unset to remove the field for undefined values
43
43
  unsetFields[key] = 1;
44
+ } else if (value === '') {
45
+ // Treat empty strings as undefined - unset the field
46
+ unsetFields[key] = 1;
44
47
  } else {
45
48
  setFields[key] = value;
46
49
  }