Skip to content
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

Merged

Conversation

jordan-smith721
Copy link
Collaborator

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

  • Is this free of any warnings or errors in the RST?
  • Did you run a spell-check?
  • Did you run a grammar-check?
  • Are all the links working?

@@ -1,12 +1,14 @@
/* Text search */

const { MongoClient } = require("mongodb");

// Replace the following string with your MongoDB deployment's connection string.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// Replace the following string with your MongoDB deployment's connection string.
// Replace the following string with your MongoDB deployment's connection string

Copy link
Collaborator

@norareidy norareidy left a 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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// 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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// 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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// 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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// 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.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// 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.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// 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");
Copy link
Collaborator

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.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// 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");
Copy link
Collaborator

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");
Copy link
Collaborator

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"

@jordan-smith721 jordan-smith721 merged commit 5b0652a into mongodb:master Sep 1, 2023
jordan-smith721 added a commit to jordan-smith721/docs-node that referenced this pull request Sep 5, 2023
(cherry picked from commit 5b0652a)
jordan-smith721 added a commit that referenced this pull request Sep 5, 2023
(cherry picked from commit 5b0652a)
mongoKart pushed a commit to mongoKart/docs-node that referenced this pull request Nov 3, 2023
caitlindavey added a commit that referenced this pull request Nov 26, 2024
* 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]>
caitlindavey added a commit to caitlindavey/docs-node that referenced this pull request Nov 26, 2024
* 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)
caitlindavey added a commit that referenced this pull request Nov 26, 2024
* 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)
caitlindavey added a commit that referenced this pull request Nov 26, 2024
* 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)
caitlindavey added a commit that referenced this pull request Nov 26, 2024
* 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)
caitlindavey added a commit that referenced this pull request Nov 26, 2024
* 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)
caitlindavey added a commit that referenced this pull request Nov 26, 2024
* 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)
caitlindavey added a commit that referenced this pull request Nov 26, 2024
* 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)
caitlindavey added a commit that referenced this pull request Nov 26, 2024
* 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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants