mongoose 6.6.7 → 6.7.0
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/dist/browser.umd.js +1 -1
- package/lib/aggregate.js +28 -8
- package/lib/document.js +42 -0
- package/lib/error/setOptionError.js +101 -0
- package/lib/error/validation.js +3 -23
- package/lib/helpers/error/combinePathErrors.js +22 -0
- package/lib/helpers/model/discriminator.js +7 -3
- package/lib/index.js +54 -18
- package/lib/model.js +14 -2
- package/lib/schema/index.js +2 -0
- package/lib/schema/uuid.js +329 -0
- package/lib/schema.js +82 -9
- package/package.json +2 -2
- package/types/aggregate.d.ts +3 -0
- package/types/expressions.d.ts +22 -0
- package/types/index.d.ts +7 -0
- package/types/inferschematype.d.ts +33 -24
- package/types/models.d.ts +9 -2
- package/types/pipelinestage.d.ts +11 -0
- package/types/schematypes.d.ts +1 -1
package/types/pipelinestage.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ declare module 'mongoose' {
|
|
|
10
10
|
| PipelineStage.Count
|
|
11
11
|
| PipelineStage.Densify
|
|
12
12
|
| PipelineStage.Facet
|
|
13
|
+
| PipelineStage.Fill
|
|
13
14
|
| PipelineStage.GeoNear
|
|
14
15
|
| PipelineStage.GraphLookup
|
|
15
16
|
| PipelineStage.Group
|
|
@@ -90,6 +91,16 @@ declare module 'mongoose' {
|
|
|
90
91
|
}
|
|
91
92
|
}
|
|
92
93
|
|
|
94
|
+
export interface Fill {
|
|
95
|
+
/** [`$fill` reference](https://docs.mongodb.com/manual/reference/operator/aggregation/fill/) */
|
|
96
|
+
$fill: {
|
|
97
|
+
partitionBy?: Expression,
|
|
98
|
+
partitionByFields?: string[],
|
|
99
|
+
sortBy?: Record<string, 1 | -1>,
|
|
100
|
+
output: Record<string, { value: Expression } | { method: 'linear' | 'locf' }>
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
93
104
|
export interface Facet {
|
|
94
105
|
/** [`$facet` reference](https://docs.mongodb.com/manual/reference/operator/aggregation/facet/) */
|
|
95
106
|
$facet: Record<string, FacetPipelineStage[]>;
|
package/types/schematypes.d.ts
CHANGED
|
@@ -57,7 +57,7 @@ declare module 'mongoose' {
|
|
|
57
57
|
T | typeof SchemaType | Schema<any, any, any> | SchemaDefinition<T> | Function | AnyArray<Function>;
|
|
58
58
|
|
|
59
59
|
/** Defines a virtual with the given name that gets/sets this path. */
|
|
60
|
-
alias?: string;
|
|
60
|
+
alias?: string | string[];
|
|
61
61
|
|
|
62
62
|
/** Function or object describing how to validate this schematype. See [validation docs](https://mongoosejs.com/docs/validation.html). */
|
|
63
63
|
validate?: SchemaValidator<T> | AnyArray<SchemaValidator<T>>;
|