-
Notifications
You must be signed in to change notification settings - Fork 213
feat: Fetching index suggestions and dealing with the states CLOUDP-311786 #6887
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
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.
Looking good, left a couple questions/thoughts!
packages/compass-indexes/src/components/create-index-form/query-flow-section.tsx
Show resolved
Hide resolved
packages/compass-indexes/src/components/create-index-form/query-flow-section.tsx
Outdated
Show resolved
Hide resolved
); | ||
|
||
const query = mql.parseQuery( | ||
EJSON.parse(inputQuery, { relaxed: false }), |
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 this work as expected with some queries? On a quick glance we might need to be parsing them with a different method. Should it be using this instead?
compass/packages/compass-indexes/src/components/search-indexes-modals/base-search-index-modal.tsx
Line 52 in bd6a3dd
const parsed = _parseShellBSON(source, { mode: ParseMode.Loose }); |
I might be wrong, haven't checked out the branch and tried it yet.
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.
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 using an ObjectId type work?
{ _id: ObjectId("578f6fa2df35c7fbdbaed8f2") }
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.
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!
if (sampleDocuments === null) { | ||
try { | ||
sampleDocuments = | ||
(await dataService.sample(namespace, { size: 50 })) || []; |
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 should mention, ideally we'd be passing an abort signal here, that way we can cancel the operation if the user closes the tab or something. I think this is fine as is for now, but something to keep in mind for future asynchronous things that allow for abort signals.
Description
https://jira.mongodb.org/browse/CLOUDP-311786
With data:

Loading:

NOTE: Error state to be fully implemented in another ticket, and create index with suggested index will also be in a separate ticket
Checklist
Motivation and Context
Open Questions
Dependents
Types of changes