You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is there any plan or ways to enable the same feature when getting a single document via DocumentReference? The code seems plenty of references to https://cloud.google.com/firestore/docs/reference/rest/v1beta1/DocumentMask which is used to restrict a get or update operation on a document to a subset of its fields, but I didn't have any luck tracking down usage of this in DocumentReference.get
Relevant Code:
// based on the select example at https://cloud.google.com/nodejs/docs/reference/firestore/0.8.x/Query#selectletcollectionRef=firestore.collection('col');letdocumentRef=collectionRef.doc('doc');documentRef.set({x:10,y:5}).then(()=>{returncollectionRef.where('x','>',5).select('y').get();}).then((res)=>{console.log(`y is ${res.docs[0].get('y')}.`);});// would like to be able to also dodocumentRef.select('y').get().then((snapShot)=>{console.log(`snapShot only has one field ${snapShot}`);// Expected output: {y: 5}});
The text was updated successfully, but these errors were encountered:
Steps to reproduce:
I have been snooping around the source code and documentation. It seems like the only way to do apply a field mask to the result and returns only the specified subset of fields is through the Query.select method.
https://cloud.google.com/nodejs/docs/reference/firestore/0.8.x/Query#select
https://github.com/googleapis/nodejs-firestore/blob/master/src/reference.js#L1080
Is there any plan or ways to enable the same feature when getting a single document via DocumentReference? The code seems plenty of references to https://cloud.google.com/firestore/docs/reference/rest/v1beta1/DocumentMask which is used to restrict a get or update operation on a document to a subset of its fields, but I didn't have any luck tracking down usage of this in DocumentReference.get
Relevant Code:
The text was updated successfully, but these errors were encountered: