currentDocument() returns an expression representing the Firestore document row the pipeline is processing. Use it when you need the full document map in a projection or when binding the document to a variable in upstream firebase-js-sdk samples.
Import from the pipelines entry point:
import { currentDocument, mapGet } from '@react-native-firebase/firestore/pipelines';Read a field from the current document map with mapGet:
import { getFirestore } from '@react-native-firebase/firestore';
import {
currentDocument,
execute,
field,
mapGet,
} from '@react-native-firebase/firestore/pipelines';
const db = getFirestore('your-enterprise-database-id');
const snapshot = await execute(
db
.pipeline()
.collection('books')
.select(mapGet(currentDocument(), 'title').as('title'), field('author').as('author')),
);
snapshot.results.forEach(row => {
console.log(row.data().title, row.data().author);
});The firebase-js-sdk also shows binding the document with a define stage:
firestore
.pipeline()
.collection('books')
.define(currentDocument().as('doc'))
.select(variable('doc').mapGet('title'));React Native Firebase does not expose the define stage yet. Until it does, prefer mapGet(currentDocument(), 'fieldName') or other helpers that accept expression arguments directly.
| Platform | Support |
|---|---|
| Android | Supported (native Firestore SDK) |
| iOS | Supported (native Firestore SDK) |
| macOS | Supported (firebase-js-sdk web interop) |
Pipeline execution requires a Firestore Enterprise database. See Pipelines overview.

Core / App