Skip to content

Commit f7157bb

Browse files
committed
Fixing map related formatting issues for mongoDB
1 parent e08a32c commit f7157bb

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,12 @@ public void DataObjectRemoteDataMap_update(String _oid, Map<String, Object> full
248248
value = Arrays.asList(value);
249249
}
250250

251+
// If value is a Map, we recast it to avoid referencing and formatting issues
252+
// this also resolves the issue when a Map, contains an array
253+
if( value instanceof Map ) {
254+
value = ConvertJSON.toMap( ConvertJSON.fromObject(value) );
255+
}
256+
251257
// Lets apply the update values
252258
if (updateKeys.contains(key)) {
253259
// Handle NULL values unset

0 commit comments

Comments
 (0)