Skip to content
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

feat(playground): Add clusteredIndex option to createCollection playground template VSCODE-330 #409

Merged

Conversation

Anemy
Copy link
Member

@Anemy Anemy commented Apr 13, 2022

VSCODE-330

This pr adds the clusteredIndex option to the createCollection playground template. This template is opened when a user clicks to create a new database or collection.

This pr also changes the behavior around where we would previously show the time-series collection creation configuration. Previously we had a separate template with these options more isolated, this pr removes the extra template and instead adds all of the options to one template.

Since there are some behavioral changes I'm going to sync with Max before we merge this. I think we wanted time-series collections to be hidden until world in the past, however I think this had the side effect that after world, users on earlier MongoDB versions would not see that time-series collections are a thing and they might want to upgrade/investigate. Synced w/ Max, he's cool with removing the version gate on showing this feature.

I opted to always show the two with a comment about the required version. I was aiming to bring it inline with the template provided in the documentation: https://www.mongodb.com/docs/v5.3/reference/method/db.createCollection/

We're also adding a link to the createCollection documentation in the template for createCollection in this pr.

updated.create.collection.tempalte.vscode.mp4

granularity: <string>
},
expireAfterSeconds: <number>,
clusteredIndex: <document>, // Added in MongoDB 5.3
Copy link
Contributor

Choose a reason for hiding this comment

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

I see for timeseries we list some options but for clusteredIndex and a few others we just say <document>. Wondering if we should put more stuff in there? Maybe best like this so they have to read the documentation.

Copy link
Member Author

Choose a reason for hiding this comment

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

We're following the docs there: https://www.mongodb.com/docs/v5.3/reference/method/db.createCollection/
Which also only expands the time-series document. I'm not totally sure on the reasoning there. I think it's alright though, since these are more complex configurations I think expanding all of them might make us have to update this more frequently, and could possibly lead some users astray on differing mongodb server versions.

Copy link
Contributor

@lerouxb lerouxb left a comment

Choose a reason for hiding this comment

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

👏

@Anemy Anemy merged commit ed24e88 into main Apr 27, 2022
@Anemy Anemy deleted the VSCODE-330-add-clustered-index-option-to-create-collection-template branch April 27, 2022 14:58
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.

2 participants