What is merge and timestampsInSnapshot in the firebase?

Viewed 1930

I am getting this error at the console; "You are overriding the original host. If you did not intend to override your settings, use {merge: true}." When ı add this code line it's solved

db.settings({ timestampsInSnapshot: true, merge: true });

Notice: timeInSnapshot settings don't relevant above error. Just ı ask what does mean it? and ı didn't write any other codes.

1 Answers

It seems that is not an error, but a warning.

enter image description here

According to Version 8.6.3 release notes:

Firestore will throw a warning message when settings() is used to override the original value of host without also setting {merge: true}.

You can also check Firestore settings documentation to better understand the use of host and merge:

  • host: The hostname to connect to.
  • merge: Whether to merge the provided settings with the existing settings. If set to true, the settings are merged with existing settings. If set to false or left unset, the settings replace the existing settings.

So it seems that without setting merge: true, you would be overriding the host, even if you were not setting it explicitly in that call.

Related