-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Closed
Labels
typescriptTypes or Types-test related issue / Pull RequestTypes or Types-test related issue / Pull Request
Milestone
Description
Prerequisites
- I have written a descriptive issue title
- I have searched existing issues to ensure the issue has not already been raised
Issue
Upgrading to v9 and the following snippet gives a type error:
const matchCondition: QueryFilter<Job> = {};
if (isComplete) {
matchCondition.completedAt = { $exists: true };
} else {
matchCondition.completedAt = { $exists: false };
}
const jobs = await JobModel.aggregate<Job>([
{ $match: matchCondition },
]);The matchCondition here has to be a QueryFilter<any> type for this code to build, but I would like to be able to use my Job type here like I could in v8.
Metadata
Metadata
Assignees
Labels
typescriptTypes or Types-test related issue / Pull RequestTypes or Types-test related issue / Pull Request