-
Notifications
You must be signed in to change notification settings - Fork 10
[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
Conversation
✅ Deploy Preview for docs-kotlin-sync ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
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 with a few suggested improvements!
source/includes/run-command.kt
Outdated
val explanation = database.runCommand({ | ||
explain: { | ||
find: 'restaurants' | ||
} | ||
}) |
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.
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.
source/includes/run-command.kt
Outdated
val explanation = database.runCommand({ | ||
explain: { | ||
find: 'restaurants' | ||
} | ||
}) |
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.
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> |
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.
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.
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.
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.
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 minor comments 👍
on your ``database`` object. If no read preference is specified, this method | ||
uses the ``primary`` read preference. | ||
|
||
Response |
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.
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() { |
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.
Any idea why we want to deviate from the existing example ?see https://www.mongodb.com/docs/drivers/kotlin/coroutine/current/usage-examples/command/ & https://www.mongodb.com/docs/drivers/java/sync/current/usage-examples/command/
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.
Updated example to include a full file
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