Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add support for fieldmask to document reference #245

Merged
merged 3 commits into from Jun 15, 2020

Conversation

suraj-qlogic
Copy link
Contributor

Fixes #227

@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Jun 9, 2020
@suraj-qlogic suraj-qlogic changed the title Add support for FieldMask to DocumentReference add support for fieldmask to document reference Jun 9, 2020
@codecov
Copy link

codecov bot commented Jun 9, 2020

Codecov Report

Merging #245 into master will increase coverage by 0.08%.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #245      +/-   ##
============================================
+ Coverage     72.92%   73.01%   +0.08%     
- Complexity     1024     1025       +1     
============================================
  Files            64       64              
  Lines          5430     5444      +14     
  Branches        614      620       +6     
============================================
+ Hits           3960     3975      +15     
- Misses         1270     1271       +1     
+ Partials        200      198       -2     
Impacted Files Coverage Δ Complexity Δ
.../com/google/cloud/firestore/DocumentReference.java 73.56% <100.00%> (+0.30%) 32.00 <1.00> (+1.00)
...restore/collection/ImmutableSortedMapIterator.java 0.00% <0.00%> (ø) 0.00% <0.00%> (ø%)
...rc/main/java/com/google/cloud/firestore/Watch.java 91.66% <0.00%> (+0.11%) 56.00% <0.00%> (ø%)
...rc/main/java/com/google/cloud/firestore/Query.java 90.96% <0.00%> (+0.16%) 105.00% <0.00%> (ø%)
...a/com/google/cloud/firestore/FirestoreOptions.java 36.97% <0.00%> (+0.53%) 7.00% <0.00%> (ø%)
...oogle/cloud/firestore/v1/FirestoreAdminClient.java 59.84% <0.00%> (+1.57%) 38.00% <0.00%> (ø%)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b5749d4...042cf9a. Read the comment docs.

@suraj-qlogic suraj-qlogic changed the title add support for fieldmask to document reference feat: add support for fieldmask to document reference Jun 9, 2020
Copy link
Collaborator

@BenWhitehead BenWhitehead left a comment

Choose a reason for hiding this comment

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

Thanks for adding this @suraj-qlogic. One small request for the integration test.

DocumentReference ref = randomColl.document("doc1");
ref.set(ALL_SUPPORTED_TYPES_MAP).get();
DocumentSnapshot documentSnapshots = ref.get(FieldMask.of("foo")).get();
assertEquals("bar", documentSnapshots.get("foo"));
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you add an assertion for the absence of one of the fields that should not be returned?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@BenWhitehead BenWhitehead merged commit 4a846b1 into googleapis:master Jun 15, 2020
gcf-merge-on-green bot pushed a commit that referenced this pull request Jun 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for FieldMask to DocumentReference.get()
3 participants