-
Notifications
You must be signed in to change notification settings - Fork 108
Firestore Method Documentation
To get an instance of the Firestore object for your project from this library, call
var firestore = FirestoreApp.getFirestore(email, key, projectId);
This page documents the methods that belong to the Firestore object.
Library version: 22
Get an object that acts as an authenticated interface with a Firestore project.
-
email
string the user email address (for authentication) -
key
string the user private key (for authentication) -
projectId
string the Firestore project ID
Returns object an authenticated interface with a Firestore project
An object that acts as an authenticated interface with a Firestore project.
-
email
string the user email address (for authentication) -
key
string the user private key (for authentication) -
projectId
string the Firestore project ID
Returns object an authenticated interface with a Firestore project
Get a document.
-
path
string the path to the document
Returns object the document object
Get a list of all documents in a collection.
-
path
string the path to the collection
Returns object an array of the documents in the collection
Get a list of all IDs of the documents in a path
-
path
string the path to the collection
Returns object an array of IDs of the documents in the collection
Create a document with the given fields and an auto-generated ID.
Returns object the Document object written to Firestore
Update/patch a document at the given path with new fields.
-
path
string the path of the document to update. If document name not provided, a random ID will be generated. -
fields
object the document's new fields -
mask
boolean if true, the update will use a mask
Returns object the Document object written to Firestore
Run a query against the Firestore Database and return an all the documents that match the query. Must call .execute() to send the request.
-
path
string to query
Returns object the JSON response from the GET request
Delete the Firestore document at the given path. Note: this deletes ONLY this document, and not any subcollections.
-
path
string the path to the document to delete
Returns object the JSON response from the DELETE request