Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

153
Visualizações
how does snapshot with (Events for metadata changes) differs than normal snapshot in cloud firestore?

What is the main difference between using { includeMetadataChanges: true } in snapshot function and not using it at all, as I understood from docs it kind of more sensitive to change ?

import { doc, onSnapshot } from "firebase/firestore";

const unsub = onSnapshot(
  doc(db, "cities", "SF"), 
  { includeMetadataChanges: true }, 
  (doc) => {
    // ...
  });
about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

When you listen for values with includeMetadataChanges: true, your callback also gets invoked when only the metadata of a snapshot has changed. Specifically this may happen when the client has verified that there were no changes on the server (so fromCache becomes true) or when local writes have been committed on the server (and so hasPendingWrites becomes false).

Without the flag, you'd not be notified of those changes, as they're not commonly shown in the UI of the app (although they definitely can be).

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda