Offset

Description

Skips the first N input documents.

Syntax

Node.js

const results = await db.pipeline()
  .collection("/cities")
  .offset(10)
  .execute();

Client examples

Node.js
const results = await db.pipeline()
  .collection("cities")
  .offset(10)
  .execute();

Web

const results = await execute(db.pipeline()
  .collection("cities")
  .offset(10));
Swift
let results = try await db.pipeline()
  .collection("cities")
  .offset(10)
  .execute()

Kotlin

val results = db.pipeline()
    .collection("cities")
    .offset(10)
    .execute()

Java

Task<Pipeline.Snapshot> results = db.pipeline()
        .collection("cities")
        .offset(10)
        .execute();
Python
results = client.pipeline().collection("cities").offset(10).execute()
Java
Pipeline.Snapshot results =
    firestore.pipeline().collection("cities").offset(10).execute().get();

Behavior

The offset stage will skip the first N input documents. Unless a sort stage is used before the offset, the order in which documents are returned is unstable and repeated executions might produce different results.