mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-16 06:50:19 +00:00
Merge pull request #14576 from lonsenluo/master
[mongoose] add unwind method with new params type
This commit is contained in:
Vendored
+5
@@ -2163,6 +2163,11 @@ declare module "mongoose" {
|
||||
* @param fields the field(s) to unwind
|
||||
*/
|
||||
unwind(...fields: string[]): this;
|
||||
/**
|
||||
* Appends new custom $unwind operator(s) to this aggregate pipeline
|
||||
* new in mongodb 3.2
|
||||
*/
|
||||
unwind(...opts: { path: string, includeArrayIndex?: string, preserveNullAndEmptyArrays?: boolean }[]): this;
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -1016,7 +1016,41 @@ aggregate.sort('field -test');
|
||||
aggregate.then(cb).catch(cb);
|
||||
aggregate.unwind("tags").unwind('tags');
|
||||
aggregate.unwind("a", "b", "c").unwind('tag1', 'tag2');
|
||||
|
||||
aggregate.unwind(
|
||||
{
|
||||
path: "tags",
|
||||
includeArrayIndex: "idx",
|
||||
preserveNullAndEmptyArrays: true
|
||||
})
|
||||
.unwind({
|
||||
path: "tags",
|
||||
includeArrayIndex: "idx",
|
||||
preserveNullAndEmptyArrays: true
|
||||
});
|
||||
aggregate.unwind(
|
||||
{
|
||||
path: "a",
|
||||
includeArrayIndex: "idx",
|
||||
preserveNullAndEmptyArrays: true
|
||||
}, {
|
||||
path: "b",
|
||||
includeArrayIndex: "idx",
|
||||
preserveNullAndEmptyArrays: true
|
||||
}, {
|
||||
path: "c",
|
||||
includeArrayIndex: "idx",
|
||||
preserveNullAndEmptyArrays: true
|
||||
})
|
||||
.unwind({
|
||||
path: "tag1",
|
||||
includeArrayIndex: "idx",
|
||||
preserveNullAndEmptyArrays: true
|
||||
}, {
|
||||
path: "tag2",
|
||||
includeArrayIndex: "idx",
|
||||
preserveNullAndEmptyArrays: true
|
||||
});
|
||||
|
||||
/*
|
||||
* section schematype.js
|
||||
* http://mongoosejs.com/docs/api.html#schematype-js
|
||||
|
||||
Reference in New Issue
Block a user