Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit d83a70c

Browse files
committed
Remove notes about findOne, deleteOne, updateOne
1 parent 6e2de72 commit d83a70c

File tree

3 files changed

+1
-7
lines changed

3 files changed

+1
-7
lines changed

‎delete.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ main().catch(console.error);
5050
/**
5151
* Delete an Airbnb listing with the given name.
5252
* Note: If more than one listing has the same name, only the first listing the database finds will be deleted.
53-
* It's best to use deleteOne when querying on fields that are guaranteed to be unique.
5453
* @param {MongoClient} client A MongoClient that is connected to a cluster with the sample_airbnb database
5554
* @param {string} nameOfListing The name of the listing you want to delete
5655
*/
@@ -74,8 +73,7 @@ async function deleteListingsScrapedBeforeDate(client, date) {
7473
/**
7574
* Print information indicating if a listing with the given name exists.
7675
* If a listing has the 'last_scraped' field, print that as well.
77-
* Note: If more than one listing has the same name, only the first listing the database finds will be printed.
78-
* It's best to use findOne when querying on fields that are guaranteed to be unique.
76+
* Note: If more than one listing has the same name, only the first listing the database finds will be printed..
7977
* @param {MongoClient} client A MongoClient that is connected to a cluster with the sample_airbnb database
8078
* @param {String} nameOfListing The name of the listing you want to find
8179
*/

‎read.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ main().catch(console.error);
4141
/**
4242
* Print an Airbnb listing with the given name
4343
* Note: If more than one listing has the same name, only the first listing the database finds will be printed.
44-
* It's best to use findOne when querying on fields that are guaranteed to be unique.
4544
* @param {MongoClient} client A MongoClient that is connected to a cluster with the sample_airbnb database
4645
* @param {String} nameOfListing The name of the listing you want to find
4746
*/

‎update.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ main().catch(console.error);
5656
/**
5757
* Update an Airbnb listing with the given name
5858
* 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.
6059
* @param {MongoClient} client A MongoClient that is connected to a cluster with the sample_airbnb database
6160
* @param {string} nameOfListing The name of the listing you want to update
6261
* @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) {
7473
* If a listing with the given name exists, it will be updated.
7574
* If a listing with the given name does not exist, it will be inserted.
7675
* 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.
7876
* Note: For educational purposes, we have split the update and upsert functionality into separate functions.
7977
* Another option is to have a single function where a boolean param indicates if the update should be an upsert.
8078
* @param {MongoClient} client A MongoClient that is connected to a cluster with the sample_airbnb database
@@ -107,7 +105,6 @@ async function updateAllListingsToHavePropertyType(client) {
107105
/**
108106
* Print an Airbnb listing with the given name
109107
* 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.
111108
* @param {MongoClient} client A MongoClient that is connected to a cluster with the sample_airbnb database
112109
* @param {String} nameOfListing The name of the listing you want to find
113110
*/

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /