Skip to content

Commit

Permalink
Merge branch 'master' of github.com:Automattic/mongoose
Browse files Browse the repository at this point in the history
  • Loading branch information
vkarpov15 committed Feb 27, 2022
2 parents 1a1d3cc + e3ce230 commit b62ea22
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2487,6 +2487,13 @@ declare module 'mongoose' {
} &
RootQuerySelector<T>;

/**
* Filter query to select the documents that match the query
* @example
* ```js
* { age: { $gte: 30 } }
* ```
*/
export type FilterQuery<T> = _FilterQuery<T>;

type AddToSetOperators<Type> = {
Expand Down Expand Up @@ -2544,6 +2551,13 @@ declare module 'mongoose' {
[K in keyof T]?: __UpdateDefProperty<T[K]>;
};

/**
* Update query command to perform on the document
* @example
* ```js
* { age: 30 }
* ```
*/
export type UpdateQuery<T> = _UpdateQuery<_UpdateQueryDef<T>> & AnyObject;

export type DocumentDefinition<T> = {
Expand Down Expand Up @@ -2586,6 +2600,12 @@ declare module 'mongoose' {
T;

export type SchemaDefinitionType<T> = T extends Document ? Omit<T, Exclude<keyof Document, '_id' | 'id' | '__v'>> : T;

/**
* Documents returned from queries with the lean option enabled.
* Plain old JavaScript object documents (POJO).
* @see https://mongoosejs.com/docs/tutorials/lean.html
*/
export type LeanDocument<T> = Omit<_LeanDocument<T>, Exclude<keyof Document, '_id' | 'id' | '__v'> | '$isSingleNested'>;

export type LeanDocumentOrArray<T> = 0 extends (1 & T) ? T :
Expand Down

0 comments on commit b62ea22

Please sign in to comment.