-
Notifications
You must be signed in to change notification settings - Fork 49
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-20071) Update TS Limitations #275
(DOCSP-20071) Update TS Limitations #275
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.
A few minor issues, would like to take another look after changes!
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.
Some issues I commented on might not be directly related to this PR, so feel free to create JIRA tickets if they are not trivial.
Responding to comments here since I'm unable to add to the outdated threads at the moment:
Re: #275 (comment)
I do not believe the style guide takes a stance on how tabs should be used.
I provided an explanation as to why it doesn't make sense. There isn't guidance on everything you shouldn't do in the style guide, and sometimes there are exceptions to items listed in the style guide. If you disagree with my reasoning, we can discuss as a team. I can ticket the work to update the style guide (or you can) -- let me know what you prefer to do here.
Re: #275 (comment)
I'm not sure a real world example will provide much value for these readers, as they likely are able to relate recursive data structures to real world examples independently.
I'm not sure it's a common use case and would be helpful to demonstrate what this is. Otherwise, I would link to an example.
This reverts commit f61c9f1.
source/fundamentals/typescript.txt
Outdated
A mutually recursive type exists when two types define themselves relative | ||
to each other. You can update the |
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.
Just for clarification, I used "property type", which seems consistent with TypeScript nomenclature according to their documentation. An example of a property type of a Type in your MutuallyRecursivePet interface is "string" for (name) or "number" (for age). Let me know if my terminology is incorrect and what the appropriate term is if so.
"Type" is unfortunately and maybe unavoidably ambiguous in the sentence, so I omitted it explicitly in my suggestion.
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.
Looks pretty good. As there's a a fair amount of new/revised content, there are some new minor issues to address.
I'm leaving an approval, but If there's new content to review or discussions required, please reach out.
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.
Just have one note here, I am not sure if we need to do anything differently for this PR or wait to merge it. I also have a question regarding where the examples of how to use dot notation correctly are, since the page only seems to talk about limitations for recursive types, but no examples of non-recursive dot notation use. Is there a follow up ticket to add that example?
collection.find({ someRandomKey: "Accepts any type!" }); | ||
const database = client.db("<your database>"); | ||
const collection = db.collection<User>("<your collection>"); | ||
collection.find({ age: "Accepts any type!" }); |
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.
Just a note that this will probably need to change soon to something like { $unknownOperator: "Accepts any type!" }
because we actually have a user submitted fix to make sure that we validate unknown keys that aren't
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.
Hi Daria! There is a ticket to add the "query nested fields without dot notation" example back to a different section of the documentation (DevED-DBX agreed that TS page seemed only tangentially related to dot notation and was not the correct place for this content).
The page that should explain to readers how to use Dot Notation is the Update Arrays in a Document Page (linking to Java), however it seems like the corresponding Node page does not explicitly discuss dot notation. I've created a ticket to add this content .
As this PR has already been through a few internal reviews and has grown to be fairly large, I think it is best to close out this pull request and handle the upcoming changes as part of a new task (any substantial additions will require an additional copy review which will take a decent amount of time as the diff for this PR has become pretty big).
Sorry for the long response! Let me know if I have failed to address any of your concerns.
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 fine with doing the $-prefix updates later, but I really feel like the current page could benefit from a working example of dot notation type hinting use (i.e., show how having the wrong type in a non-recursive collection definition raises a typescript error)
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.
Good point, I agree an example of working dot notation type checking would benefit readers. I've added a "dot notation" subsection to the Features section Let me know if this addresses your concerns!
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.
Just a small nit here, otherwise looks good, thank you! Though I'd like @baileympearson or @nbbeeken to take a look just to make sure we haven't missed anything, since new docs are pretty extensive.
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, good example of dot notation's type safety, I appreciate us sticking with the Pet theme 😁
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 - thanks for implementing all the feedback! Please wait for @nbbeeken to take a second look before merging
Pull Request Info
Remove limitation around dot notation. Add warning around recursive types.
Issue JIRA link:
https://jira.mongodb.org/browse/DOCSP-20071
+
https://jira.mongodb.org/browse/DOCSP-20417
Snooty build log:
https://workerpool-boxgs.mongodbstitch.com/pages/job.html?collName=queue&jobId=61f81a59382d7fe4ee46b528
Docs staging link (requires sign-in on MongoDB Corp SSO):
https://docs-mongodbcom-staging.corp.mongodb.com/node/docsworker-xlarge/DOCSP-20071-Support-Dot-Notation-TS/fundamentals/typescript/
Self-Review Checklist
If your page documents a concept, does it meet the following criteria?