@react-native-firebase/appinstalled and native config completed per Getting Started.@react-native-firebase/firestoreinstalled and rebuilt into the native app.- A Firestore Enterprise database. See Pipelines overview.
- Import expression helpers from
@react-native-firebase/firestore/pipelines.
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.
Read a field from the 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. React Native Firebase exposes the same define stage and variable() helper. Bind the document, then read fields with mapGet(variable('doc'), 'fieldName'). For a direct projection without a named binding, prefer mapGet(currentDocument(), 'fieldName') as in the Basic example above.
currentDocument() is typed as Expression, so the sample uses a JSDoc cast to FunctionExpression before calling .as(); .as() is not on every Expression.
import { getFirestore } from '@react-native-firebase/firestore';
import {
currentDocument,
execute,
mapGet,
variable,
} from '@react-native-firebase/firestore/pipelines';
const firestore = getFirestore('your-enterprise-database-id');
const currentDoc =
/** @type {import('@react-native-firebase/firestore/pipelines').FunctionExpression} */ (
currentDocument()
);
const snapshot = await execute(
firestore
.pipeline()
.collection('books')
.define(currentDoc.as('doc'))
.select(mapGet(variable('doc'), 'title')),
);
snapshot.results.forEach(row => {
console.log(row.data().title);
});{/* prettier-ignore */}
| 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