Skip to content

(DOCSP-43745) Connect to MongoDB #61

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

Merged
merged 16 commits into from
Oct 2, 2024

Conversation

amalhotra-mdb
Copy link
Collaborator

@amalhotra-mdb amalhotra-mdb commented Oct 1, 2024

Pull Request Info

Fill out root page for "Connect to MongoDB" (created as stub in this ticket).

A/C: I can see all the operations for connecting to MongoDB in a section.

PR Reviewing Guidelines

JIRA - https://jira.mongodb.org/browse/DOCSP-43745
Staging - https://deploy-preview-61--docs-c.netlify.app/connect/

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?
  • Are the facets and meta keywords accurate?

Copy link

netlify bot commented Oct 1, 2024

Deploy Preview for docs-c ready!

Name Link
🔨 Latest commit 1b4867c
🔍 Latest deploy log https://app.netlify.com/sites/docs-c/deploys/66fd8b828e073d00083029f3
😎 Deploy Preview https://deploy-preview-61--docs-c.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Collaborator

@mcmorisi mcmorisi left a comment

Choose a reason for hiding this comment

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

LGTM with a few nits/questions!

Comment on lines 21 to 22
fprintf (stderr, "%s\n", error.message);
goto cleanup;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Q: Should these have the same indentation?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yup fixed it!

Comment on lines 103 to 104
mongoc_client_t *client = mongoc_client_new (uri);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nit: we use underlines for the placeholders elsewhere in this page, I think we should stick to that.

Suggested change
char *uri = "mongodb://<replica-set-member>:<port>/?replicaSet=<replica-set-name>";
mongoc_client_t *client = mongoc_client_new (uri);
char *uri = "mongodb://<replica_set_member>:<port>/?replicaSet=<replica_set_name>";
mongoc_client_t *client = mongoc_client_new (uri);

.. code-block:: c

mongoc_client_t *client = mongoc_client_new("mongodb://<db_username>:<db_password>@<hostname>:<port>/?server_selector=<selector-function>");
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same nit as above

Suggested change
mongoc_client_t *client = mongoc_client_new("mongodb://<db_username>:<db_password>@<hostname>:<port>/?server_selector=<selector-function>");
mongoc_client_t *client = mongoc_client_new("mongodb://<db_username>:<db_password>@<hostname>:<port>/?server_selector=<selector_function>");

@amalhotra-mdb
Copy link
Collaborator Author

amalhotra-mdb commented Oct 2, 2024

@kevinAlbs thanks so much for all your help and thoroughness on these C standardization PRs!

Comment on lines 72 to 73
client = mongoc_client_new_from_uri (uri);
Copy link
Collaborator

@kevinAlbs kevinAlbs Oct 2, 2024

Choose a reason for hiding this comment

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

Suggested change
uri = mongoc_uri_new ("mongodb://localhost:27017");
client = mongoc_client_new_from_uri (uri);
client = mongoc_client_new ("mongodb://localhost:27017");

Suggest not using uri for consistency with tabbed examples.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Not yet addressed.

Copy link
Collaborator

@kevinAlbs kevinAlbs left a comment

Choose a reason for hiding this comment

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

LGTM with one comment addressed.

Comment on lines 72 to 73
client = mongoc_client_new_from_uri (uri);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Not yet addressed.

@amalhotra-mdb amalhotra-mdb merged commit 263de2a into mongodb:standardization Oct 2, 2024
4 of 5 checks passed
@amalhotra-mdb amalhotra-mdb deleted the DOCSP-43745 branch October 2, 2024 18:09
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.

3 participants