Skip to content

Releases: grahamearley/FirestoreGoogleAppsScript

Version 23: Date Fixes

01 May 22:23
09738e4
Compare
Choose a tag to compare

This release comes after a long break.

  • Timestamp fields should no longer have issues when updating documents with a Date object. Thanks @Spencer-Easton! #71
  • Fixed issues with Apps Script not being able to handle Timestamps with microseconds. #42
  • Added a Query Range function which is a shorthand for .offset and .range functions. #77
var db = getFirestore(email, key, project);
var results10_15 = db.query(path).range(10, 15).execute();

Which is equivalent to:

var db = getFirestore(email, key, project);
var results10_15 = db.query(path).offset(10).limit(5).execute();

Breaking Changes

  • When retreiving documents the createTime and updateTime document properties are JS Date objects and not Timestamp Strings.

Version 22: Update with mask

21 Sep 00:48
97b3b3c
Compare
Choose a tag to compare

Now the update function includes an extra boolean parameter, mask. When true, the update will apply as a mask. So if your document looks like this:

{ number: 1, text: "Hello" }

and you call update with mask = true with this object as your mask:

{ number: 2 } 

then the number field will be updated, but the text field will not. The resulting document will be

{ number: 2, text: "Hello" }

Thanks to @webstermath for this feature!

Version 21: Array contains query operator

14 Sep 11:51
5896447
Compare
Choose a tag to compare

This version adds a new operator for querying. You can now query for documents with an array field that contains some value. For example, say you have a collection "My Collection" of documents that each have an array field called numbers. To find all documents with 42 in their numbers array, you can now query like this:

firestore.query("My Collection").where("numbers", "contains", 42).execute();

Thanks to @joao-azevedo-hydradev for this addition!

Version 19: Query isNan hotfix

29 Jun 14:41
3895dde
Compare
Choose a tag to compare

This release is a hotfix for a bug in v18, where our isNaN check said that any non-number type was NaN. Now the check only checks for NaN if the value is of type number.

Version 18: Improve querying API for null, undefined, and NaN values

27 Jun 00:38
f3978b7
Compare
Choose a tag to compare

This version merges in another nice PR from @LaughDonor (#33), which the query method where(field, "==", null) to be equivalent to the query method where(field, "null") (similarly for undefined, NaN).

Version 17: fix bug where documents with empty arrays cause an error

09 Jun 17:41
b98bd97
Compare
Choose a tag to compare

Before this version, an empty array in a document would cause an error in the library. No more! Thanks for finding the issue @adyscorpius, and thanks for the fix @LaughDonor.

Version 16: Queries and support for all data types

31 May 13:47
a4ddd20
Compare
Choose a tag to compare

This version adds support for querying within collection! It also adds support for all data types you can store in Firestore (including timestamps, geopoints, and references to other documents).

See documentation here.

Huge thanks to @LaughDonor for the great work in this release.

v14: Merge branch 'master' of https://github.com/grahamearley/FirestoreGoo…

31 May 14:05
Compare
Choose a tag to compare

Versions 8 through 14 are all essentially the same — I was just getting used to using the clasp library and so I accidentally deployed a few times with the wrong release description :)