FirestoreGoogleAppsScript icon indicating copy to clipboard operation
FirestoreGoogleAppsScript copied to clipboard

Improve README Documentation for updateDocument, Specific Fields

Open aanguelo opened this issue 3 years ago • 1 comments

Is your feature request related to a problem?

Yes, to a degree. I spent quite a bit of time trying to figure out the updateDocument specific field functionality. I feel a bit more detail would be helpful for others who are new to FS.

Describe the solution you'd like

Expand the README documentation for the updateDocument specific field functionality to detail what needs to be passed for the "data" parameter. See the two forms I have used below. I have not done so yet, but also can be updated from an object using JSON.

fs.updateDocument("Accounts/" + accountID,  {'standing': AccountStanding.GOOD}, true);

var accountProperties = { 'standing': AccountStanding.GOOD, 'createDate': new Date(), 'timezone': Session.getScriptTimeZone() };
fs.updateDocument("Accounts/" + accountID, accountProperties, true);

Describe alternatives you've considered

N/A

Additional context

N/A

aanguelo avatar Feb 04 '22 14:02 aanguelo

Both of those ultimately boil down to the same usage:

fs.updateDocument(strPath, objFieldsToUpdate, true);

So I'm not sure what you are wanting to clarify. I'm happy to check out any pull requests you may want to submit!

LaughDonor avatar Feb 04 '22 22:02 LaughDonor