Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

447
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda