Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

444
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!