mongoose 5.13.9 → 5.13.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.d.ts +5 -3
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -1004,8 +1004,8 @@ declare module 'mongoose' {
|
|
|
1004
1004
|
findOneAndRemove(filter?: FilterQuery<T>, options?: QueryOptions | null, callback?: (err: CallbackError, doc: EnforceDocument<T, TMethods> | null, res: any) => void): QueryWithHelpers<EnforceDocument<T, TMethods> | null, EnforceDocument<T, TMethods>, TQueryHelpers, T>;
|
|
1005
1005
|
|
|
1006
1006
|
/** Creates a `findOneAndReplace` query: atomically finds the given document and replaces it with `replacement`. */
|
|
1007
|
-
findOneAndReplace(filter: FilterQuery<T>, replacement: DocumentDefinition<T
|
|
1008
|
-
findOneAndReplace(filter?: FilterQuery<T>, replacement?: DocumentDefinition<T
|
|
1007
|
+
findOneAndReplace(filter: FilterQuery<T>, replacement: DocumentDefinition<T> | AnyObject, options: QueryOptions & { upsert: true } & ReturnsNewDoc, callback?: (err: CallbackError, doc: EnforceDocument<T, TMethods>, res: any) => void): QueryWithHelpers<EnforceDocument<T, TMethods>, EnforceDocument<T, TMethods>, TQueryHelpers, T>;
|
|
1008
|
+
findOneAndReplace(filter?: FilterQuery<T>, replacement?: DocumentDefinition<T> | AnyObject, options?: QueryOptions | null, callback?: (err: CallbackError, doc: EnforceDocument<T, TMethods> | null, res: any) => void): QueryWithHelpers<EnforceDocument<T, TMethods> | null, EnforceDocument<T, TMethods>, TQueryHelpers, T>;
|
|
1009
1009
|
|
|
1010
1010
|
/** Creates a `findOneAndUpdate` query: atomically find the first document that matches `filter` and apply `update`. */
|
|
1011
1011
|
findOneAndUpdate(filter: FilterQuery<T>, update: UpdateQuery<T> | UpdateWithAggregationPipeline, options: QueryOptions & { rawResult: true }, callback?: (err: CallbackError, doc: mongodb.FindAndModifyWriteOpResultObject<EnforceDocument<T, TMethods>>, res: any) => void): QueryWithHelpers<mongodb.FindAndModifyWriteOpResultObject<EnforceDocument<T, TMethods>>, EnforceDocument<T, TMethods>, TQueryHelpers, T>;
|
|
@@ -1589,13 +1589,15 @@ declare module 'mongoose' {
|
|
|
1589
1589
|
currentTime?: () => (NativeDate | number);
|
|
1590
1590
|
}
|
|
1591
1591
|
|
|
1592
|
+
type AnyArray<T> = T[] | ReadonlyArray<T>;
|
|
1593
|
+
|
|
1592
1594
|
type Unpacked<T> = T extends (infer U)[] ? U : T;
|
|
1593
1595
|
|
|
1594
1596
|
export class SchemaTypeOptions<T> {
|
|
1595
1597
|
type?:
|
|
1596
1598
|
T extends string | number | boolean | NativeDate | Function ? SchemaDefinitionWithBuiltInClass<T> :
|
|
1597
1599
|
T extends Schema<any, any> ? T :
|
|
1598
|
-
T extends object[] ? (
|
|
1600
|
+
T extends object[] ? (AnyArray<Schema<Unpacked<T>>> | AnyArray<Schema<Document & Unpacked<T>>> | AnyArray<SchemaDefinition<Unpacked<T>>>) :
|
|
1599
1601
|
T extends string[] ? (SchemaDefinitionWithBuiltInClass<string>[] | ReadonlyArray<SchemaDefinitionWithBuiltInClass<string>>) :
|
|
1600
1602
|
T extends number[] ? (SchemaDefinitionWithBuiltInClass<number>[] | ReadonlyArray<SchemaDefinitionWithBuiltInClass<number>>) :
|
|
1601
1603
|
T extends boolean[] ? (SchemaDefinitionWithBuiltInClass<boolean>[] | ReadonlyArray<SchemaDefinitionWithBuiltInClass<boolean>>) :
|