You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Allow API version selection (defaults to "v1beta1").
Add "IN" and "Contains_Any" Query field operators (usable only with "v1" API).
Expand Firestore.getDocuments to get specific named documents.
Update README link and minor documentation.
Copy file name to clipboardExpand all lines: .github/README.md
+13-5Lines changed: 13 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -27,10 +27,10 @@ To make a service account,
27
27
5. When you press "Create," your browser will download a `.json` file with your private key (`private_key`), service account email (`client_email`), and project ID (`project_id`). Copy these values into your Google Apps Script — you'll need them to authenticate with Firestore.
28
28
29
29
#### Create a test document in Firestore from your script
30
-
Now, with your service account client email address `email`, private key `key`, and project ID `projectId`, we will authenticate with Firestore to get our `Firestore` object. To do this, get the `Firestore` object from the library:
30
+
Now, with your service account client email address `email`, private key `key`, project ID `projectId`, and Firestore API version, we will authenticate with Firestore to get our `Firestore` object. To do this, get the `Firestore` object from the library:
31
31
32
32
```javascript
33
-
var firestore =FirestoreApp.getFirestore(email, key, projectId);
33
+
var firestore =FirestoreApp.getFirestore(email, key, projectId, "v1");
34
34
```
35
35
36
36
Using this Firestore instance, we will create a Firestore document with a field `name` with value `test!`. Let's encode this as a JSON object:
@@ -71,20 +71,28 @@ You can also retrieve all documents within a collection by using the `getDocumen
> Utilize `createDocument(path + '/' + documentId, fields)` instead to create a document with a specific ID.
85
93
86
94
## Contributions
87
-
Contributions are welcome — send a pull request! This library is a work in progress. See [here](https://github.com/grahamearley/FirestoreGoogleAppsScript/blob/master/CONTRIBUTING.md) for more information on contributing.
95
+
Contributions are welcome — send a pull request! This library is a work in progress. See [here](https://github.com/grahamearley/FirestoreGoogleAppsScript/blob/master/.github/CONTRIBUTING.md) for more information on contributing.
88
96
89
97
After cloning this repository, you can push it to your own private copy of this Google Apps Script project to test it yourself. See [here](https://github.com/google/clasp) for directions on using `clasp` to develop App Scripts locally.
0 commit comments