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 772922d

Browse files
Merge pull request #13 from va6un/master
Warning workaround. Use unused variable
2 parents b07915d + 67b6c67 commit 772922d

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

‎read.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ async function main() {
1010
/**
1111
* The Mongo Client you will use to interact with your database
1212
* See https://mongodb.github.io/node-mongodb-native/3.6/api/MongoClient.html for more details
13+
* In case: '[MONGODB DRIVER] Warning: Current Server Discovery and Monitoring engine is deprecated...'
14+
* pass option { useUnifiedTopology: true } to the MongoClient constructor.
15+
* const client = new MongoClient(uri, {useUnifiedTopology: true})
1316
*/
1417
const client = new MongoClient(uri);
1518

@@ -89,14 +92,14 @@ async function findListingsWithMinimumBedroomsBathroomsAndMostRecentReviews(clie
8992
if (results.length > 0) {
9093
console.log(`Found listing(s) with at least ${minimumNumberOfBedrooms} bedrooms and ${minimumNumberOfBathrooms} bathrooms:`);
9194
results.forEach((result, i) => {
92-
date = new Date(result.last_review).toDateString();
95+
constdate = new Date(result.last_review).toDateString();
9396

9497
console.log();
9598
console.log(`${i + 1}. name: ${result.name}`);
9699
console.log(` _id: ${result._id}`);
97100
console.log(` bedrooms: ${result.bedrooms}`);
98101
console.log(` bathrooms: ${result.bathrooms}`);
99-
console.log(` most recent review date: ${newDate(result.last_review).toDateString()}`);
102+
console.log(` most recent review date: ${date}`);
100103
});
101104
} else {
102105
console.log(`No listings found with at least ${minimumNumberOfBedrooms} bedrooms and ${minimumNumberOfBathrooms} bathrooms`);

0 commit comments

Comments
(0)

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