mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-09-25 10:30:25 +00:00
Merge pull request #28240 from idandrd/master
Added replaceRoot method to Aggregate prototype
This commit is contained in:
Vendored
+8
-1
@@ -1,4 +1,4 @@
|
||||
// Type definitions for Mongoose 5.2.2
|
||||
// Type definitions for Mongoose 5.2.3
|
||||
// Project: http://mongoosejs.com/
|
||||
// Definitions by: horiuchi <https://github.com/horiuchi>
|
||||
// sindrenm <https://github.com/sindrenm>
|
||||
@@ -2409,6 +2409,13 @@ declare module "mongoose" {
|
||||
*/
|
||||
read(pref: string, tags?: any[]): this;
|
||||
|
||||
/**
|
||||
* Appends a new $replaceRoot operator to this aggregate pipeline.
|
||||
* Note that the $replaceRoot operator requires field strings to start with '$'. If you are passing in a string Mongoose will prepend '$' if the specified field doesn't start '$'. If you are passing in an object the strings in your expression will not be altered.
|
||||
* @param newRoot field or document which will become the new root document
|
||||
*/
|
||||
replaceRoot(newRoot: string | object): this;
|
||||
|
||||
/**
|
||||
* Appends new custom $sample operator(s) to this aggregate pipeline.
|
||||
* @param size number of random documents to pick
|
||||
|
||||
@@ -1264,6 +1264,8 @@ aggregate.project({
|
||||
})
|
||||
aggregate.project({ salary_k: { $divide: [ "$salary", 1000 ]}});
|
||||
aggregate.read('primaryPreferred').read('pp');
|
||||
aggregate.replaceRoot("user");
|
||||
aggregate.replaceRoot({x: {$concat: ['$this', '$that']}});
|
||||
aggregate.sample(3).sample(3);
|
||||
aggregate.skip(10).skip(10);
|
||||
aggregate.sort({ field: 'asc', test: -1 });
|
||||
|
||||
Reference in New Issue
Block a user