FirestoreGoogleAppsScript Versions Save

A Google Apps Script library for accessing Google Cloud Firestore.

v33

3 years ago
  • Added Document.path property to get the local path of a document from the database. Thanks @juliusn for this! #99
  • Updated Tests to check for the above and fix tests that couldn't fail!
  • Updated README with a section that denotes all the Document properties.
  • Updated dependent packages.

Usage

To utilize the new version:

  1. Edit your Google Apps Script
  2. Open Resources > Libraries... from the menu.
  3. Change the version dropdown to 33 next to FirestoreApp (or whatever name you use locally).

v32

3 years ago
  • Updated Tests badge on README such that clicking on it will rerun the Tests and cache the results properly.
  • Cleaned up Tests.ts.
  • Silenced npm errors when running "lint" and "fix" scripts.
  • Updated dependent packages.

Updates to the Tests file requires a new version for Live Tests to be runnable.

Usage

To utilize the new version:

  1. Edit your Google Apps Script
  2. Open Resources > Libraries... from the menu.
  3. Change the version dropdown to 32 next to FirestoreApp.

v31

3 years ago
  • Fixed issue where extracting maps/objects nested within arrays would fail. Thanks @marcolong for bringing up this issue! #95
  • Updated Test cases.

Usage

To utilize the new version:

  1. Edit your Google Apps Script
  2. Open Resources > Libraries... from the menu.
  3. Change the version dropdown to 31 next to FirestoreApp.

v30

3 years ago
  • Fixed bug where .getDocuments and .query didn't return Document.obj data. Thanks @tricknotes for the nice find! #94
  • Added .gitattributes to handle line endings. Again, thanks @tricknotes for bringing this up. #93

Thanks to @tricknotes for these quick finds!

Usage

To utilize the new version:

  1. Edit your Google Apps Script
  2. Open Resources > Libraries... from the menu.
  3. Change the version dropdown to 30 next to FirestoreApp.

v29

3 years ago

The new badges from v27 were nice, but the Testing badge wouldn't display. This is because GitHub anonymizes images on the README pages.

This is great, however the service times out after 3 seconds, and the image is dynamically generated after running the tests.. and this took more than 3 seconds.

I took the liberty of running the tests every hour via. Script Trigger and caching the results. This should allow the badge to pull up the cached results and load them onto the README.

No library update is required for this.

v28

3 years ago
  • Fixed a minor issue where Date objects created would not be recognized as a Date object. #86

Thanks to all that brought up the issue and @rielzzapps for narrowing it down.

Usage

To utilize the new version:

  1. Edit your Google Apps Script
  2. Open Resources > Libraries... from the menu.
  3. Change the version dropdown to 28 next to FirestoreApp.

v27

3 years ago

Breaking Changes

  • Query function names have been capitalized (Select, Where, OrderBy, Limit, Offset, Range).
  • All functions return Document or Document[] types directly from Firebase. Use document.obj to extract the raw object.
  • Undo breaking change from v23. document.createTime and document.updateTime will remain as timestamped strings. However document.created, document.updated, and document.read are Date objects.

Usage

To utilize the new version:

  1. Edit your Google Apps Script
  2. Open Resources > Libraries... from the menu.
  3. Change the version dropdown to 27 next to FirestoreApp.

Your project runtime (V8 or Rhino) is independent of this library and they do not have to align for things to run.

v26

4 years ago

The Firebase API's PATCH endpoint to update documents does not handle the creation of documents with dynamic names.

This issue has been solved in v26, and now correctly creates documents when a document name is omitted from the path in .createDocument(path, fields) function.

Collections and documents with special characters are still created properly.

v25 has been removed from the Apps Script Library.

Thanks @shoumik1 for raising this issue. #85

v25

4 years ago

This release allows for virtually any Collection, Document, and Field names can be utilized. International characters and most symbols are supported.

Since API projects.databases.documents/createDocument does not properly handle escaped document names, document creation is handled by the patch endpoint.

Field names have been internally wrapped with the backtick (`) character as recommended.

If any characters are found to not be handled properly, please create an issue with the character(s) to address.

v24

4 years ago

The Firebase REST API has been updated with 3 available versions. This application originally supported "v1beta1", and now supports "v1beta2" and "v1".

  • To start utilizing another version (such as "v1") update your initial constructor to: FirestoreApp.getFirestore(email, key, projectId, "v1");
    • If version is omitted, it defaults to "v1beta1". This will change in the future.
  • v1 supports to utilization of the new .query().filter() operators: "IN" and "Contains_Any" (case-insensitive).

The .getDocuments() function now allows for an optional second parameter to only select specific documents by name.

  • const someDocuments = firestore.getDocuments("FirstCollection", ["Doc1", "Doc2", "Doc3"]);

Thanks to @ken-prayogo for the feature request. #79