Releases: grahamearley/FirestoreGoogleAppsScript
Version 23: Date Fixes
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
andupdateTime
document properties are JS Date objects and not Timestamp Strings.
Version 22: Update with mask
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
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
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
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
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
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
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 :)