Skip to content

Conversation

addaleax
Copy link
Collaborator

No description provided.

Copy link
Collaborator

@gribnoysup gribnoysup left a comment

Choose a reason for hiding this comment

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

Looks good!

assertArgsDefinedType([name], ['string']);
const { db, coll } = name.match(/^(?<db>[^.]+)\.(?<coll>.+)$/)?.groups ?? {};
if (!db || !coll) {
throw new MongoshInvalidInputError('Collection must be of the format <db>.<collection>', CommonErrors.InvalidArgument);
Copy link
Collaborator

Choose a reason for hiding this comment

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

This error message is so much better than the old one 👏

@addaleax addaleax merged commit bbf2a73 into main May 20, 2021
@addaleax addaleax deleted the 620-dev-2 branch May 20, 2021 14:02
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