Skip to content

Commit 5ab5dbb

Browse files
committed
Experimenting with wierd "remove" not working behaviour
1 parent 95d84b1 commit 5ab5dbb

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

src/main/java/picoded/dstack/mongodb/MongoDB_DataObjectMap.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,13 +268,20 @@ public void DataObjectRemoteDataMap_update(String _oid, Map<String, Object> full
268268
if (updateKeys.contains(key)) {
269269
// Handle NULL values unset
270270
if (value == null || value == ObjectToken.NULL) {
271-
unset_doc.append(key, 1);
271+
unset_doc.append(key, "");
272272
continue;
273273
}
274274

275275
// Handle values update
276276
set_doc.append(key, value);
277277
continue;
278+
} else {
279+
// It seems like for some reason NULL might not be properly triggering the updateKeys?
280+
if (value == null || value == ObjectToken.NULL) {
281+
unset_doc.append(key, "");
282+
set_doc.append(key, null);
283+
setOnInsert_doc.append(key, null);
284+
}
278285
}
279286

280287
// OK - this is not in the update dataset

0 commit comments

Comments
 (0)