New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
7.3 #13499
Conversation
Co-authored-by: hasezoey <hasezoey@gmail.com>
Co-authored-by: hasezoey <hasezoey@gmail.com>
Co-authored-by: hasezoey <hasezoey@gmail.com>
…oose into vkarpov15/schematype-get
feat(schema): consistently add `.get()` function to all SchemaType classes
Update mongodb driver 5.6.0
Model.create() ordered option
…ch fields are projected Fix #13224
types: allow overwriting `Paths` in `select()` to tell TypeScript which fields are projected
feat(populate): pass virtual to `match` function to allow merging match options
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aside from the one types issue, these changes seems to be work just fine with current latest typegoose (both tsc build and runtime & types tests)
types/query.d.ts
Outdated
select<Paths extends { [P in keyof ResultType]?: any } = {}>( | ||
arg: string | string[] | Record<string, number | boolean | object> | ||
): QueryWithHelpers< | ||
UnpackedIntersection<{}, Paths>, | ||
DocType, | ||
THelpers, | ||
UnpackedIntersection<{}, Paths>, | ||
QueryOp | ||
>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this does not seem to give the proper type when testing against typegoose 11.2.0 (current latest for mongoose 7.2.3)
error:
test/tests/indexes.test.ts:25:108 - error TS2339: Property 'toObject' does not exist on type '{}'.
25 const fSExtra = (await SelectModel.findOne({}).select(['+test1', '+test3', '-test2']).orFail().exec()).toObject();
~~~~~~~~
code:
const fSExtra = (await SelectModel.findOne({}).select(['+test1', '+test3', '-test2']).orFail().exec()).toObject();
hovering over .exec()
says it returns a Promise<{}>
, meaning not a document
likely because generic ResultType
(first generic) in QueryWithHelpers
is because it operates on {}
changing to the following return fixes the error, though i dont know if they are the proper intended types (similar to what .populate
returns):
QueryWithHelpers<
UnpackedIntersection<ResultType, Paths>,
DocType,
THelpers,
UnpackedIntersection<RawDocType, Paths>,
QueryOp
>;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
…iedOnly added test case for schema option `validateModifiedOnly`
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
current version of e8987d0 runs file (both in types and runtime) in typegoose
… with Promise API for TypeScript
feat(aggregate): add `Aggregate.prototype.finally()` to be consistent with Promise API for TypeScript
…ncurrency-array Island rhythms/optimistic concurrency array
Summary
Examples