@@ -56,7 +56,6 @@ main().catch(console.error);
56
56
/**
57
57
* Update an Airbnb listing with the given name
58
58
* Note: If more than one listing has the same name, only the first listing the database finds will be updated.
59
- * It's best to use updateOne when querying on fields that are guaranteed to be unique.
60
59
* @param {MongoClient } client A MongoClient that is connected to a cluster with the sample_airbnb database
61
60
* @param {string } nameOfListing The name of the listing you want to update
62
61
* @param {object } updatedListing An object containing all of the properties to be updated for the given listing
@@ -74,7 +73,6 @@ async function updateListingByName(client, nameOfListing, updatedListing) {
74
73
* If a listing with the given name exists, it will be updated.
75
74
* If a listing with the given name does not exist, it will be inserted.
76
75
* Note: If more than one listing has the same name, only the first listing the database finds will be updated.
77
- * It's best to use updateOne when querying on fields that are guaranteed to be unique.
78
76
* Note: For educational purposes, we have split the update and upsert functionality into separate functions.
79
77
* Another option is to have a single function where a boolean param indicates if the update should be an upsert.
80
78
* @param {MongoClient } client A MongoClient that is connected to a cluster with the sample_airbnb database
@@ -107,7 +105,6 @@ async function updateAllListingsToHavePropertyType(client) {
107
105
/**
108
106
* Print an Airbnb listing with the given name
109
107
* Note: If more than one listing has the same name, only the first listing the database finds will be printed.
110
- * It's best to use findOne when querying on fields that are guaranteed to be unique.
111
108
* @param {MongoClient } client A MongoClient that is connected to a cluster with the sample_airbnb database
112
109
* @param {String } nameOfListing The name of the listing you want to find
113
110
*/
0 commit comments