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
in simpleQuery function, reference to a collection is named citiesRef (1) and query on this ref is named queryRef (2) - both with ref at the end. Only the result of the query is named res (3)
asyncfunctionsimpleQuery(db){// Create a reference to the cities collectionconstcitiesRef=db.collection('cities');// (1)// Create a query against the collectionconstqueryRef=citiesRef.where('state','==','CA');// (2)// [END firestore_query_filter_eq_string]constres=awaitqueryRef.get();// (3)res.forEach(doc=>{console.log(doc.id,' => ',doc.data());});}
however in queryAndFilter function we have a query on a ref that ends with a res in the variable name (1). Shouldn't it be called allCapitalsRef? What is the proper naming convention?
asyncfunctionqueryAndFilter(db){// Create a reference to the cities collectionconstcitiesRef=db.collection('cities');// Create a query against the collectionconstallCapitalsRes=citiesRef.where('capital','==',true);// (1)// ...rest of the function}
snippets-node/firestore/main/index.js
Line 590 in cccc005
in
simpleQuery
function, reference to a collection is namedcitiesRef
(1) and query on this ref is namedqueryRef
(2) - both withref
at the end. Only the result of the query is namedres
(3)however in
queryAndFilter
function we have a query on a ref that ends with ares
in the variable name (1). Shouldn't it be calledallCapitalsRef
? What is the proper naming convention?The code is provided at https://firebase.google.com/docs/firestore/query-data/queries#simple_queries
The text was updated successfully, but these errors were encountered: