From e827c045481328285bc6d1ec7399fd624bb2a8ef Mon Sep 17 00:00:00 2001 From: Emmanuel Gautier Date: Tue, 29 Oct 2019 20:56:03 +0100 Subject: [PATCH] mongoose: query wtimeout (#39679) --- types/mongoose/index.d.ts | 2 ++ types/mongoose/mongoose-tests.ts | 2 ++ 2 files changed, 4 insertions(+) diff --git a/types/mongoose/index.d.ts b/types/mongoose/index.d.ts index 584f645b7b..bb90829e91 100644 --- a/types/mongoose/index.d.ts +++ b/types/mongoose/index.d.ts @@ -2244,6 +2244,8 @@ declare module "mongoose" { within(val?: any): this; within(coordinate: number[], ...coordinatePairs: number[][]): this; + wtimeout(ms?: number): this; + /** Flag to opt out of using $geoWithin. */ static use$geoWithin: boolean; } diff --git a/types/mongoose/mongoose-tests.ts b/types/mongoose/mongoose-tests.ts index c6962a3711..27ae1772dc 100644 --- a/types/mongoose/mongoose-tests.ts +++ b/types/mongoose/mongoose-tests.ts @@ -1037,6 +1037,8 @@ query.batchSize(100).batchSize(100); var lowerLeft = [40.73083, -73.99756] var upperRight = [40.741404, -73.988135] query.where('loc').within().box(lowerLeft, upperRight) +query.where('loc').wtimeout() +query.where('loc').wtimeout(10) query.box({ ll : lowerLeft, ur : upperRight }).box({}); var queryModel = mongoose.model('QModel') query.cast(new queryModel(), {}).hasOwnProperty('');