<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/introducing-count-ttls-and-better-scaling-in-firestore-ene1p3zdu" -->

---
title: Introducing COUNT, TTLs, and better scaling in Firestore
description: Firestore adds count aggregation queries that return document counts without downloading full result sets, available across Web, Android, iOS, and Node.js...
canonical: https://daily.dev/posts/introducing-count-ttls-and-better-scaling-in-firestore-ene1p3zdu
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Introducing COUNT, TTLs, and better scaling in Firestore | daily.dev
og:description: Firestore adds count aggregation queries that return document counts without downloading full result sets, available across Web, Android, iOS, and Node.js...
og:url: https://daily.dev/posts/introducing-count-ttls-and-better-scaling-in-firestore-ene1p3zdu
og:image: https://api.daily.dev/og/posts/Ene1p3zDU.png
og:image:alt: Introducing COUNT, TTLs, and better scaling in Firestore
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Introducing COUNT, TTLs, and better scaling in Firestore

**[Firebase](https://daily.dev/sources/firebase-blog)** · 6 min read · 0 upvotes · 0 comments

## Summary

Firestore adds count aggregation queries that return document counts without downloading full result sets, available across Web, Android, iOS, and Node.js SDKs. Scaling limits on reads, writes, and concurrent real-time connections have been removed entirely. A new time-to-live (TTL) policy feature lets developers automatically delete documents after a specified timestamp, with deletion typically occurring within 72 hours of expiry. Count and TTLs are both currently in Preview.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://firebase.blog/posts/2022/12/introducing-firestore-count-ttl-scale>

## Questions this post answers

### How do I get a count of documents in a Firestore query without downloading all the documents?

Use the getCountFromServer function, now available in Firestore's Web, Android, iOS, and Node.js SDKs. Call it with a collection reference or query, such as getCountFromServer(query(collectionRef, where(...))), and read the result from snapshot.data().count. It works with collection group queries too, and is currently a server-only method in Preview with no offline or realtime support.

_Developers optimizing Firestore query costs can track SDK feature rollouts like this on daily.dev._

### Does Firestore have automatic document expiration or TTL support?

Yes, Firestore now offers Preview support for time-to-live (TTL) policies. You mark a timestamp field, such as an expiry field, and configure the policy through the Google Cloud Console or the Firestore data editor shortcut. Documents are deleted after their expiry timestamp, typically within 72 hours of that date, not immediately.

_Teams managing data retention in Firestore can follow schema and policy changes like this on daily.dev._

### What are the current scaling limits for reads, writes, and connections in Firestore?

Firestore no longer imposes a maximum on reads per second, writes per second, or concurrent real-time connections. Previously these hard limits forced high-scale applications to defensively architect their data structures to avoid hitting throughput ceilings; removing them makes scaling on Firestore easier without special workarounds.

_Architects planning high-scale Firestore deployments can watch for platform limit changes on daily.dev._

## Similar posts on daily.dev

- [Firestore Adds Pipeline Operations with Over 100 New Query Features](https://daily.dev/posts/firestore-adds-pipeline-operations-with-over-100-new-query-features-dm1dqw0jf) · InfoQ · 0 upvotes · 0 comments
- [Cache: Stop Asking the Database the Same Question](https://daily.dev/posts/cache-stop-asking-the-database-the-same-question-qjeabvnp4) · Medium · 1 upvotes · 1 comments
- [New Firestore query engine enables pipelines](https://daily.dev/posts/new-firestore-query-engine-enables-pipelines-qveysfcui) · Google Cloud · 0 upvotes · 0 comments
- [We moved off Firestore. The slow page stayed slow.](https://daily.dev/posts/we-moved-off-firestore-the-slow-page-stayed-slow--4d6gl5l6z) · iO tech\_hub · 0 upvotes · 0 comments
- [Stop Guessing Cache Lifetimes: TTL-Based Storage on Android](https://daily.dev/posts/stop-guessing-cache-lifetimes-ttl-based-storage-on-android-yagtc2rbq) · ProAndroidDev · 0 upvotes · 0 comments

---

Tags: [#backend](https://daily.dev/tags/backend), [#firebase](https://daily.dev/tags/firebase), [#nosql](https://daily.dev/tags/nosql), [#firestore](https://daily.dev/tags/firestore)

[View this post on daily.dev](https://daily.dev/posts/introducing-count-ttls-and-better-scaling-in-firestore-ene1p3zdu)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Introducing COUNT, TTLs, and better scaling in Firestore","url":"https://daily.dev/posts/introducing-count-ttls-and-better-scaling-in-firestore-ene1p3zdu","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/introducing-count-ttls-and-better-scaling-in-firestore-ene1p3zdu"},"datePublished":"2026-08-23T12:21:24.286Z","dateModified":"2026-08-23T12:47:36.687Z","description":"Firestore adds count aggregation queries that return document counts without downloading full result sets, available across Web, Android, iOS, and Node.js...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/d40a3909f089713f1c0f55558287175e?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/d40a3909f089713f1c0f55558287175e?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Firebase","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Firebase","logo":"https://media.daily.dev/image/upload/s--i395oqZH--/f_auto,q_auto/v1787487448/logos/firebase-blog?_a=BAMAMicg0","url":"https://daily.dev/sources/firebase-blog"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/introducing-count-ttls-and-better-scaling-in-firestore-ene1p3zdu","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"backend,firebase,nosql,firestore","timeRequired":"PT6M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Firebase","item":"https://daily.dev/sources/firebase-blog"},{"@type":"ListItem","position":3,"name":"Introducing COUNT, TTLs, and better scaling in Firestore"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/introducing-count-ttls-and-better-scaling-in-firestore-ene1p3zdu#faq","mainEntity":[{"@type":"Question","name":"How do I get a count of documents in a Firestore query without downloading all the documents?","acceptedAnswer":{"@type":"Answer","text":"Use the getCountFromServer function, now available in Firestore's Web, Android, iOS, and Node.js SDKs. Call it with a collection reference or query, such as getCountFromServer(query(collectionRef, where(...))), and read the result from snapshot.data().count. It works with collection group queries too, and is currently a server-only method in Preview with no offline or realtime support. Developers optimizing Firestore query costs can track SDK feature rollouts like this on daily.dev."}},{"@type":"Question","name":"Does Firestore have automatic document expiration or TTL support?","acceptedAnswer":{"@type":"Answer","text":"Yes, Firestore now offers Preview support for time-to-live (TTL) policies. You mark a timestamp field, such as an expiry field, and configure the policy through the Google Cloud Console or the Firestore data editor shortcut. Documents are deleted after their expiry timestamp, typically within 72 hours of that date, not immediately. Teams managing data retention in Firestore can follow schema and policy changes like this on daily.dev."}},{"@type":"Question","name":"What are the current scaling limits for reads, writes, and connections in Firestore?","acceptedAnswer":{"@type":"Answer","text":"Firestore no longer imposes a maximum on reads per second, writes per second, or concurrent real-time connections. Previously these hard limits forced high-scale applications to defensively architect their data structures to avoid hitting throughput ceilings; removing them makes scaling on Firestore easier without special workarounds. Architects planning high-scale Firestore deployments can watch for platform limit changes on daily.dev."}}]}
```

