Closed
Description
[REQUIRED] Describe your environment
- Operating System version: macOS Hight Sierra
- Browser version: chrome Version 67.0.3396.99
- Firebase SDK version: 5.4.1
- Firebase Product: firestore
[REQUIRED] Describe the problem
Steps to reproduce:
when update document with set function and merge option true, i will lose the inner empty objects.
Relevant Code:
var doc = { obj1: { key1: true } , obj2: {} };
firestore.collection('item').doc('item-1').set(doc);
//without merge option
// the stored doc on firestore server will be { obj1: { key1: true } , obj2: {} } => this correct
//******************************
firestore.collection('item').doc('item-1').set(doc, { merge: true });
//with merge option
// the stored doc on firestore server will be { obj1: { key1: true } } => this missing the obj2
Is this normal behavior?
Thanks