Hint query option isn't used in Compass

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: 1.46.2
    • Component/s: Query Bar
    • Environment:
      OS:
      node.js / npm versions:
      Additional info:
    • None
    • None
    • Developer Tools

      We added hint to the query options, but it's not actually used in the crud tab, or schema tab when we perform the operations:
      https://github.com/mongodb-js/compass/blob/1e95d95cc2326941618e33ceb4792707c096afbc/packages/compass-crud/src/stores/crud-store.ts#L1639 

       

      For this ticket we should do two things, first, we should add a validator to mongodb-query-parser to validate hints:

      https://github.com/mongodb-js/devtools-shared/blob/47abaf9320f1e4fb699fac415a53860cbce371c5/packages/query-parser/src/index.ts#L293 

      Next we need to use the hint field when we perform operations in the query/aggregation options for the crud tab, schema tab, and explain.

      This can be very loose as hints can be strings or documents:
      https://www.mongodb.com/docs/manual/reference/method/cursor.hint/ 

      Adding the validator to mongodb-query-parser will get rid of this noisy log (happens on every query in Compass):

       

      PR where we added hint: 

      https://github.com/mongodb-js/compass/pull/5666 

            Assignee:
            Unassigned
            Reporter:
            Rhys Howell
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: