-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added code comments #772
Added code comments #772
Conversation
@@ -1,12 +1,14 @@ | |||
/* Text search */ | |||
|
|||
const { MongoClient } = require("mongodb"); | |||
|
|||
// Replace the following string with your MongoDB deployment's connection string. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// Replace the following string with your MongoDB deployment's connection string. | |
// Replace the following string with your MongoDB deployment's connection string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM + small suggestions
const client = new MongoClient(uri); | ||
|
||
async function word(movies) { | ||
// start word text example | ||
// Create a query that searches for the specified string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// Create a query that searches for the specified string | |
// Create a query that searches for the "trek" string |
for await (const doc of cursor) { | ||
console.dir(doc); | ||
} | ||
} | ||
|
||
async function phrase(movies) { | ||
// start phrase text example | ||
// Create a query that searches for the specified phrase |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// Create a query that searches for the specified phrase | |
// Create a query that searches for the phrase "star trek" |
for await (const doc of cursor) { | ||
console.dir(doc); | ||
} | ||
} | ||
|
||
async function negation(movies) { | ||
// start negation text example | ||
// Create a query that searches for a specified phrase while omitting another |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// Create a query that searches for a specified phrase while omitting another | |
// Create a query that searches for a specified phrase while omitting the "into darkness" phrase |
for await (const doc of cursor) { | ||
console.dir(doc); | ||
} | ||
} | ||
|
||
async function relevance(movies) { | ||
// start relevance text example | ||
// Create a query that searches for a specified phrase while omitting another |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// Create a query that searches for a specified phrase while omitting another | |
// Create a query that searches for a specified phrase while omitting the "into darkness" phrase |
// string. | ||
const uri = | ||
"mongodb+srv://<clusterUrl>/?replicaSet=rs&writeConcern=majority"; | ||
// Replace the following with your MongoDB deployment's connection string. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// Replace the following with your MongoDB deployment's connection string. | |
// Replace the following with your MongoDB deployment's connection string |
@@ -1,3 +1,5 @@ | |||
/* Update multiple documents */ | |||
|
|||
import { MongoClient } from "mongodb"; | |||
|
|||
// Replace the uri string with your MongoDB deployment's connection string. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// Replace the uri string with your MongoDB deployment's connection string. | |
// Replace the uri string with your MongoDB deployment's connection string |
@@ -10,20 +12,22 @@ async function run() { | |||
const database = client.db("sample_mflix"); | |||
const movies = database.collection("movies"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
S: briefly explain what these two lines are doing
@@ -1,3 +1,5 @@ | |||
/* Update multiple documents */ | |||
|
|||
import { MongoClient } from "mongodb"; | |||
|
|||
// Replace the uri string with your MongoDB deployment's connection string. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// Replace the uri string with your MongoDB deployment's connection string. | |
// Replace the uri string with your MongoDB deployment's connection string |
@@ -22,6 +25,8 @@ async function run() { | |||
try { | |||
const database = client.db("sample_mflix"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
S: comment that the user is connecting to the "sample_mflix" database
@@ -22,6 +25,8 @@ async function run() { | |||
try { | |||
const database = client.db("sample_mflix"); | |||
const movies = database.collection<Movie>("movies"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
S: comment that the collection is "movies"
(cherry picked from commit 5b0652a)
* DOCSP-31824: Update page titles (#774) (cherry picked from commit 9cd60b1) * DOCSP-30081: Fix find to find() * docsp-32718 - add comments (#770) (cherry picked from commit 11461c3) * Added code comments (#772) (#778) (cherry picked from commit 5b0652a) * removed nested components * fixing bulkWrite * Fixing bulkwrite --------- Co-authored-by: Nora Reidy <[email protected]> Co-authored-by: Mike Woofter <[email protected]> Co-authored-by: Jordan Smith <[email protected]>
* DOCSP-31824: Update page titles (mongodb#774) (cherry picked from commit 9cd60b1) * DOCSP-30081: Fix find to find() * docsp-32718 - add comments (mongodb#770) (cherry picked from commit 11461c3) * Added code comments (mongodb#772) (mongodb#778) (cherry picked from commit 5b0652a) * removed nested components * fixing bulkWrite * Fixing bulkwrite --------- Co-authored-by: Nora Reidy <[email protected]> Co-authored-by: Mike Woofter <[email protected]> Co-authored-by: Jordan Smith <[email protected]> (cherry picked from commit fa3f2bc)
* DOCSP-31824: Update page titles (#774) (cherry picked from commit 9cd60b1) * DOCSP-30081: Fix find to find() * docsp-32718 - add comments (#770) (cherry picked from commit 11461c3) * Added code comments (#772) (#778) (cherry picked from commit 5b0652a) * removed nested components * fixing bulkWrite * Fixing bulkwrite --------- Co-authored-by: Nora Reidy <[email protected]> Co-authored-by: Mike Woofter <[email protected]> Co-authored-by: Jordan Smith <[email protected]> (cherry picked from commit fa3f2bc)
* DOCSP-31824: Update page titles (#774) (cherry picked from commit 9cd60b1) * DOCSP-30081: Fix find to find() * docsp-32718 - add comments (#770) (cherry picked from commit 11461c3) * Added code comments (#772) (#778) (cherry picked from commit 5b0652a) * removed nested components * fixing bulkWrite * Fixing bulkwrite --------- Co-authored-by: Nora Reidy <[email protected]> Co-authored-by: Mike Woofter <[email protected]> Co-authored-by: Jordan Smith <[email protected]> (cherry picked from commit fa3f2bc)
* DOCSP-31824: Update page titles (#774) (cherry picked from commit 9cd60b1) * DOCSP-30081: Fix find to find() * docsp-32718 - add comments (#770) (cherry picked from commit 11461c3) * Added code comments (#772) (#778) (cherry picked from commit 5b0652a) * removed nested components * fixing bulkWrite * Fixing bulkwrite --------- Co-authored-by: Nora Reidy <[email protected]> Co-authored-by: Mike Woofter <[email protected]> Co-authored-by: Jordan Smith <[email protected]> (cherry picked from commit fa3f2bc)
* DOCSP-31824: Update page titles (#774) (cherry picked from commit 9cd60b1) * DOCSP-30081: Fix find to find() * docsp-32718 - add comments (#770) (cherry picked from commit 11461c3) * Added code comments (#772) (#778) (cherry picked from commit 5b0652a) * removed nested components * fixing bulkWrite * Fixing bulkwrite --------- Co-authored-by: Nora Reidy <[email protected]> Co-authored-by: Mike Woofter <[email protected]> Co-authored-by: Jordan Smith <[email protected]> (cherry picked from commit fa3f2bc)
* DOCSP-31824: Update page titles (#774) (cherry picked from commit 9cd60b1) * DOCSP-30081: Fix find to find() * docsp-32718 - add comments (#770) (cherry picked from commit 11461c3) * Added code comments (#772) (#778) (cherry picked from commit 5b0652a) * removed nested components * fixing bulkWrite * Fixing bulkwrite --------- Co-authored-by: Nora Reidy <[email protected]> Co-authored-by: Mike Woofter <[email protected]> Co-authored-by: Jordan Smith <[email protected]> (cherry picked from commit fa3f2bc)
* DOCSP-31824: Update page titles (#774) (cherry picked from commit 9cd60b1) * DOCSP-30081: Fix find to find() * docsp-32718 - add comments (#770) (cherry picked from commit 11461c3) * Added code comments (#772) (#778) (cherry picked from commit 5b0652a) * removed nested components * fixing bulkWrite * Fixing bulkwrite --------- Co-authored-by: Nora Reidy <[email protected]> Co-authored-by: Mike Woofter <[email protected]> Co-authored-by: Jordan Smith <[email protected]> (cherry picked from commit fa3f2bc)
* DOCSP-31824: Update page titles (#774) (cherry picked from commit 9cd60b1) * DOCSP-30081: Fix find to find() * docsp-32718 - add comments (#770) (cherry picked from commit 11461c3) * Added code comments (#772) (#778) (cherry picked from commit 5b0652a) * removed nested components * fixing bulkWrite * Fixing bulkwrite --------- Co-authored-by: Nora Reidy <[email protected]> Co-authored-by: Mike Woofter <[email protected]> Co-authored-by: Jordan Smith <[email protected]> (cherry picked from commit fa3f2bc)
Pull Request Info
PR Reviewing Guidelines
JIRA - https://jira.mongodb.org/browse/DOCSP-32718
Staging - https://docs-mongodbcom-staging.corp.mongodb.com/node/docsworker-xlarge/DOCSP-32718-code-commenting/
Self-Review Checklist