Skip to content

Releases: grahamearley/FirestoreGoogleAppsScript

Version 33: Added Document.path and Tests

09 Jul 23:56
Compare
Choose a tag to compare
  • 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).

Version 32: Updated Tests and Testing Badge

25 Jun 21:22
Compare
Choose a tag to compare
  • 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.

Version 31: Bugfix - Nested Objects inside Arrays

25 Jun 21:16
Compare
Choose a tag to compare
  • 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.

Version 30: Bugfixes and Markdown Links

24 Jun 05:27
Compare
Choose a tag to compare
  • 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.

Version 29: Test Caching

22 Jun 22:04
Compare
Choose a tag to compare

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.

Version 28: Date data bugfix

22 Jun 20:50
Compare
Choose a tag to compare
  • 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.

Version 27: V8 Runtime Overhaul

16 Jun 03:39
Compare
Choose a tag to compare

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.

Version 26: Create Document Bugfix

13 May 18:00
Compare
Choose a tag to compare

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

Version 25: Firebase Naming Stability

11 May 17:00
Compare
Choose a tag to compare

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.

Version 24: Firebase v1 API Support

04 May 17:04
Compare
Choose a tag to compare

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