fix(dataset): export index and metadata columns in exportAll (#7436)
The schema-detection aggregate in exportAll builds its $match from teamId (returned by authDataset as a string). find() casts the string to ObjectId, but aggregate() does not schema-cast $match values, so the aggregation matched zero documents. exportSchema became undefined, indexCount/hasMetadata fell back to 0/false, and the CSV header collapsed to q,a. Wrap teamId and dataset _ids in Types.ObjectId so the aggregate $match works. dataset _ids are already ObjectId from .lean(), so that wrap is defensive. Co-authored-by: Claude <noreply@anthropic.com>
Showing
Please
register
or
sign in
to comment