-
Type:
Task
-
Resolution: Unresolved
-
Priority:
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.