Skip to content

[Kotlin Sync] Run a Command #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 11 commits into from
Jan 28, 2025
Merged

Conversation

rachel-mack
Copy link
Collaborator

@rachel-mack rachel-mack commented Jan 24, 2025

Pull Request Info

PR Reviewing Guidelines

JIRA - https://jira.mongodb.org/browse/DOCSP-46791
Staging - https://deploy-preview-61--docs-kotlin-sync.netlify.app/run-command/

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 Jan 24, 2025

Deploy Preview for docs-kotlin-sync ready!

Name Link
🔨 Latest commit d3dafcf
🔍 Latest deploy log https://app.netlify.com/sites/docs-kotlin-sync/deploys/67992fff58de710008e38673
😎 Deploy Preview https://deploy-preview-61--docs-kotlin-sync.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 suggested improvements!

Comment on lines 6 to 10
val explanation = database.runCommand({
explain: {
find: 'restaurants'
}
})
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'd double check this with the tech reviewer to confirm conventions, but the documentation in this repo uses the Document() constructor to build BSON documents.

Comment on lines 6 to 10
val explanation = database.runCommand({
explain: {
find: 'restaurants'
}
})
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
val explanation = database.runCommand({
explain: {
find: 'restaurants'
}
})
val explanation = database.runCommand(Document("explain", Document("find", "restaurants"))
)

@@ -22,6 +22,7 @@
Aggregation Operations </agg-exp-ops>
Specialized Data Formats </data-formats>
Builders </builders>
Run a Command </run-command>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we move the Run a Command page under a top-level drawer named Databases and Collections? Similar to how we do it in Scala and [C])https://www.mongodb.com/docs/languages/c/c-driver/current/databases-collections/run-command/). The Databases and Collections page can be empty for now.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'm going to leave this here based on conversations with Caitlin and Sarah Lin around the unified TOC. This is definitely a weird L1 topic, but it's where we landed. I agree that it's a weird place for it.

Copy link

@nhachicha nhachicha left a comment

Choose a reason for hiding this comment

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

LGTM minor comments 👍

on your ``database`` object. If no read preference is specified, this method
uses the ``primary`` read preference.

Response

Choose a reason for hiding this comment

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

I don't think this section is present in the current Java https://www.mongodb.com/docs/drivers/java/sync/current/usage-examples/command/ or Coroutine version https://www.mongodb.com/docs/drivers/kotlin/coroutine/current/usage-examples/command/
I think it will be valuable to add this section to the other JVM drivers.

import com.mongodb.kotlin.client.MongoClient
import org.bson.Document

fun main() {

Choose a reason for hiding this comment

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

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Updated example to include a full file

@rachel-mack rachel-mack merged commit b94ee13 into mongodb:master Jan 28, 2025
6 checks passed
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