File tree 2 files changed +8
-2
lines changed 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -416,6 +416,12 @@ class _NitriteDocument extends Document {
416
416
// if there are more splits, then this is an embedded document
417
417
// so remove the element at the next level
418
418
item._deepRemove (remainingSplits.sublist (1 ));
419
+ if (item.isEmpty) {
420
+ // if the next level document is an empty one
421
+ // remove the current level document also
422
+ value.removeAt (index);
423
+ _documentMap[key] = value;
424
+ }
419
425
} else {
420
426
// if there are no more splits, then this is a primitive value
421
427
// so remove the element at the next level
Original file line number Diff line number Diff line change @@ -228,8 +228,8 @@ void main() {
228
228
229
229
expect (doc["objArray" ].length, 2 );
230
230
doc.remove ("objArray:0:value" );
231
- expect (doc["objArray" ].length, 2 );
232
- expect (doc["objArray:0" ].size, 0 );
231
+ expect (doc["objArray" ].length, 1 );
232
+ expect (doc["objArray:0" ].size, 1 );
233
233
});
234
234
235
235
test ("Get Fields" , () {
You can’t perform that action at this time.
0 commit comments