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

443
Visualizações
Why did firestore move from firestore.collection() to collection(firestore)?

It used to be

db.collection("customersData").add({
      name: customerName,
      password: customerPassword,
    });

Now it is

async function getCities(db) {
  const citiesCol = collection(db, 'cities');
  const citySnapshot = await getDocs(citiesCol);
  const cityList = citySnapshot.docs.map(doc => doc.data());
  return cityList;
}

And you have to import the methods seperately import { getFirestore, collection, getDocs } from 'firebase/firestore/lite';.

What was the reason for this?
Is it possible to use the old way of writing still?

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

What was the reason for this?

You can read about it in the release notes for version 9.

This release introduces the new modular API, which enables tree-shaking, bundle size reduction, and other benefits. See SDK versions 8 and 9 for more details.

Is it possible to use the old way of writing still?

Yes, you can use any prior version of the SDK before the changes in 9.

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