GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Adding FieldMask support to GetAll() by schmidt-sebastian · Pull Request #443 · googleapis/nodejs-firestore

This repository was archived by the owner on Mar 4, 2026. It is now read-only.

Conversation

@schmidt-sebastian

@schmidt-sebastian schmidt-sebastian commented Nov 9, 2018 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

This adds a ReadOptions argument to getAll() to allow users to specify a field mask.

I tried to keep the API useable and declared the first argument of the varargs method so that it is known the DocumentReferences have to be passed first.

Fixes: #42

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Nov 9, 2018
@schmidt-sebastian
schmidt-sebastian force-pushed the mrschmidt-getall branch from bea0b9d to 6bdd121 Compare November 9, 2018 23:39
@schmidt-sebastian
Adding FieldMask support to GetAll()
01b892d
@schmidt-sebastian
schmidt-sebastian force-pushed the mrschmidt-getall branch from 6bdd121 to 01b892d Compare November 9, 2018 23:39
@schmidt-sebastian
schmidt-sebastian requested a review from gsoltis November 9, 2018 23:40
@schmidt-sebastian schmidt-sebastian assigned gsoltis Nov 9, 2018
gsoltis
gsoltis suggested changes Nov 10, 2018
View reviewed changes
Comment thread dev/src/index.ts
* @param options.fieldMask - The subset of fields to return from a read
* operation.
*/
export function validateReadOptions(options: ReadOptions): boolean {

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Comment thread dev/src/transaction.ts Outdated
if (refOrQuery instanceof DocumentReference) {
return this._firestore
.getAll_([refOrQuery], this._requestTag, this._transactionId)
.getAll_([refOrQuery], null, this._requestTag, this._transactionId)

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Comment thread dev/src/util.ts Outdated
let documents: DocumentReference[];
let readOptions: ReadOptions|undefined = undefined;

const usesVarags = !Array.isArray(documentRefsOrReadOptions[0]);

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Comment thread dev/src/util.ts Outdated
documents = documentRefsOrReadOptions as DocumentReference[];
}
} else {
// Support an array of document references as the first argument for

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Comment thread dev/test/index.ts
return createInstance(overrides).then(firestore => {
return firestore.getAll(firestore.doc('collectionId/documentId'))
return (firestore as InvalidApiUsage)
.getAll([firestore.doc('collectionId/documentId')])

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@gsoltis gsoltis assigned schmidt-sebastian and unassigned gsoltis Nov 10, 2018
@schmidt-sebastian
Review feedback
f6cbd36
@schmidt-sebastian
schmidt-sebastian force-pushed the mrschmidt-getall branch from 738ce7e to f6cbd36 Compare November 10, 2018 23:09
schmidt-sebastian
schmidt-sebastian commented Nov 10, 2018
View reviewed changes

@schmidt-sebastian schmidt-sebastian left a comment

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comments addressed. Thanks for the review.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread dev/src/index.ts
* @param options.fieldMask - The subset of fields to return from a read
* operation.
*/
export function validateReadOptions(options: ReadOptions): boolean {

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Comment thread dev/src/transaction.ts Outdated
if (refOrQuery instanceof DocumentReference) {
return this._firestore
.getAll_([refOrQuery], this._requestTag, this._transactionId)
.getAll_([refOrQuery], null, this._requestTag, this._transactionId)

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Comment thread dev/src/util.ts Outdated
let documents: DocumentReference[];
let readOptions: ReadOptions|undefined = undefined;

const usesVarags = !Array.isArray(documentRefsOrReadOptions[0]);

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Comment thread dev/src/util.ts Outdated
documents = documentRefsOrReadOptions as DocumentReference[];
}
} else {
// Support an array of document references as the first argument for

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Comment thread dev/test/index.ts
return createInstance(overrides).then(firestore => {
return firestore.getAll(firestore.doc('collectionId/documentId'))
return (firestore as InvalidApiUsage)
.getAll([firestore.doc('collectionId/documentId')])

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@schmidt-sebastian schmidt-sebastian assigned gsoltis Nov 10, 2018
gsoltis
gsoltis approved these changes Nov 11, 2018
View reviewed changes
@JustinBeckwith
Merge branch 'master' into mrschmidt-getall
880a434
@schmidt-sebastian
schmidt-sebastian merged commit 791eacc into master Nov 12, 2018
@schmidt-sebastian schmidt-sebastian mentioned this pull request Nov 19, 2018
Firestore: Adding FieldMask support to GetAll() googleapis/google-cloud-java#4017
Merged
@jmdobry
jmdobry deleted the mrschmidt-getall branch December 5, 2018 07:07
@ushu ushu mentioned this pull request Dec 28, 2018
Typings: Cannot destructure array anymore when calling getAll #501
Closed
@snyk-bot snyk-bot mentioned this pull request Dec 5, 2019
[Snyk] Upgrade @google-cloud/firestore from 0.17.0 to 0.21.0 dyna-dot/g.gl_communityresources#8
Open
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Reviewers

1 more reviewer
@gsoltis gsoltis gsoltis approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@gsoltis gsoltis

@schmidt-sebastian schmidt-sebastian

Labels

cla: yes This human has signed the Contributor License Agreement.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@schmidt-sebastian @gsoltis @googlebot @JustinBeckwith
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.