Skip to content

Commit 9d474d9

Browse files
authored
Clarify some query snippets
See: firebase#186
1 parent 6d42e41 commit 9d474d9

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

firestore/test.firestore.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -856,9 +856,9 @@ describe("firestore", () => {
856856
it("should handle other wheres", () => {
857857
var citiesRef = db.collection("cities");
858858
// [START example_filters]
859-
citiesRef.where("state", "==", "CA");
860-
citiesRef.where("population", "<", 100000);
861-
citiesRef.where("name", ">=", "San Francisco");
859+
const nameQuery = citiesRef.where("state", "==", "CA");
860+
const populationQuery = citiesRef.where("population", "<", 100000);
861+
const nameQuery = citiesRef.where("name", ">=", "San Francisco");
862862
// [END example_filters]
863863

864864
// [START simple_query_not_equal]
@@ -900,16 +900,16 @@ describe("firestore", () => {
900900
it("should handle compound queries", () => {
901901
var citiesRef = db.collection("cities");
902902
// [START chain_filters]
903-
citiesRef.where("state", "==", "CO").where("name", "==", "Denver");
904-
citiesRef.where("state", "==", "CA").where("population", "<", 1000000);
903+
const q1 = citiesRef.where("state", "==", "CO").where("name", "==", "Denver");
904+
const q2 = citiesRef.where("state", "==", "CA").where("population", "<", 1000000);
905905
// [END chain_filters]
906906
});
907907

908908
it("should handle range filters on one field", () => {
909909
var citiesRef = db.collection("cities");
910910
// [START valid_range_filters]
911-
citiesRef.where("state", ">=", "CA").where("state", "<=", "IN");
912-
citiesRef.where("state", "==", "CA").where("population", ">", 1000000);
911+
const q1 = citiesRef.where("state", ">=", "CA").where("state", "<=", "IN");
912+
const q2 = citiesRef.where("state", "==", "CA").where("population", ">", 1000000);
913913
// [END valid_range_filters]
914914
});
915915

0 commit comments

Comments
 (0)