Uploaded image for project: 'Compass '
  1. Compass
  2. COMPASS-9150

Change schema sample to pass cursor to analysis, not full doc array

    • Type: Icon: Task Task
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Schema
    • None
    • Developer Tools

      The schema analysis in mongodb-schema is already set up to take an async iterable. The Compass side however currently performs a toArray when doing the sample:
      https://github.com/mongodb-js/compass/blob/d6b51a751f80c29be5c2d3fc579ed4711a1cb87d/packages/compass-schema/src/modules/schema-analysis.ts#L53
      https://github.com/mongodb-js/compass/blob/d6b51a751f80c29be5c2d3fc579ed4711a1cb87d/packages/data-service/src/data-service.ts#L2255

      I'm thinking in general we probably don't want to be doing that .toArray there and instead leave it up for consumers to do that. The sample is used in a couple other places we'll have to update if we do that, so maybe lets just do this one if that's a good amount of work.

            Assignee:
            Unassigned Unassigned
            Reporter:
            rhys.howell@mongodb.com Rhys Howell
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: