-
Notifications
You must be signed in to change notification settings - Fork 59
DOCSP-15571 productize new async writer #199
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
DOCSP-15571 productize new async writer #199
Conversation
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.
Thanks for the changes, @davemungo! I've left some comments and questions for you.
Thanks!
Joe
Constructors | ||
~~~~~~~~~~~~ | ||
|
||
The following constructors will not work: |
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.
[suggestion]
Consider using the present tense.
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.
Done
return db[ collectionOne ].estimatedDocumentCount() - db[ collectionOne ].estimatedDocumentCount() ) | ||
} ); | ||
|
||
Use ``.map`` instead. |
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.
[suggestion]
I suggest adding the ()
for consistency with usage on line 14.
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.
Done
@@ -0,0 +1,104 @@ | |||
.. Top level title in calling page, won't render in right TOC | |||
|
|||
The results of database calls cannot be passed inside the following |
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.
[question]
Are we expecting users to already be familiar with the terminology "database calls"?
I see we're using .find()
ops as an examples throughout -- are there other common types of calls that ought to spring to mind?
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.
Yes, I think this page really only applies for users with a fair amount of experience. Changed to 'queries' though as a clarification.
I'm not sure about other operations, I've added findMany(), but that's pretty much the same thing. find() is perhaps the most obvious because it will return data that you want to do something with. I can raise the question on tech review.
<https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for-await...of>`__, | ||
or ``.map()``. | ||
|
||
Constructors |
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.
[praise]
I like the "do not use this approach" vs "instead, use this approach" structure here. Clean!
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.
Thanks!
Generator Functions | ||
~~~~~~~~~~~~~~~~~~~ | ||
|
||
The following generator functions will not work: |
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.
Similar comment as line 19.
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.
Done
Array Sort | ||
~~~~~~~~~~ | ||
|
||
The following array sort will not work: |
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.
Similar comment as lines 19, 54.
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.
Done
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.
@jmd-mongo thanks for your feedback, this is ready for another pass.
@@ -0,0 +1,104 @@ | |||
.. Top level title in calling page, won't render in right TOC | |||
|
|||
The results of database calls cannot be passed inside the following |
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.
Yes, I think this page really only applies for users with a fair amount of experience. Changed to 'queries' though as a clarification.
I'm not sure about other operations, I've added findMany(), but that's pretty much the same thing. find() is perhaps the most obvious because it will return data that you want to do something with. I can raise the question on tech review.
<https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for-await...of>`__, | ||
or ``.map()``. | ||
|
||
Constructors |
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.
Thanks!
Constructors | ||
~~~~~~~~~~~~ | ||
|
||
The following constructors will not work: |
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.
Done
Generator Functions | ||
~~~~~~~~~~~~~~~~~~~ | ||
|
||
The following generator functions will not work: |
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.
Done
Array Sort | ||
~~~~~~~~~~ | ||
|
||
The following array sort will not work: |
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.
Done
return db[ collectionOne ].estimatedDocumentCount() - db[ collectionOne ].estimatedDocumentCount() ) | ||
} ); | ||
|
||
Use ``.map`` instead. |
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.
Done
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.
Thanks for the changes, @davemungo! This one LGTM.
Thanks,
Joe
@addaleax Would you have a look at these updates? Two technical questions - The examples use a find() query. Does it make sense to show an example with some other sort of query? Thanks! |
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.
Is it ok to say, "database queries" instead of "database calls"?
I think you can do that – but keep in mind that this applies to anything that interacts with the database in some way (for example, commands rather than queries).
The examples use a find() query. Does it make sense to show an example with some other sort of query?
I don’t think you’d need to provide explicit examples here – the limitations and workarounds would apply identically to any other database call (or database query 🙂)
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.
@addaleax Thanks for your feedback. I added a short note about the aysnch alternative.
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.
@davemungo please address mistake and resubmit PR. Cheers.
Array Sort | ||
~~~~~~~~~~ | ||
|
||
The following array sort do not work: |
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.
"does not work"
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.
Thanks @jason-price-mongodb
I've updated "do not" to "does not"
STAGING
https://docs-mongodbcom-staging.corp.mongodb.com/mongodb-shell/docsworker-xlarge/DOCSP-15571-productize-new-async-rewriter/reference/compatibility/#limitations-on-database-calls
https://docs-mongodbcom-staging.corp.mongodb.com/mongodb-shell/docsworker-xlarge/DOCSP-15571-productize-new-async-rewriter/write-scripts/
JIRA
https://jira.mongodb.org/browse/DOCSP-15571
[MONGOSH] Productize new async rewriter