Skip to content

Commit

Permalink
fix: removed geoNear deprecation
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Reggi authored Oct 12, 2020
1 parent 800e71e commit a3408e6
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/cursor/aggregation_cursor.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { MongoError } from '../error';
import { Cursor, CursorOptions } from './cursor';
import { CursorState } from './core_cursor';
import { deprecate } from 'util';
import type { AggregateOperation, AggregateOptions } from '../operations/aggregate';
import type { Document } from '../bson';
import type { Sort } from '../operations/find';
Expand Down Expand Up @@ -110,8 +109,8 @@ export class AggregationCursor extends Cursor<AggregateOperation, AggregationCur

// deprecated methods
/** @deprecated Add a geoNear stage to the aggregation pipeline */
geoNear = deprecate(($geoNear: Document) => {
geoNear($geoNear: Document): this {
this.operation.addToPipeline({ $geoNear });
return this;
}, 'The `$geoNear` stage is deprecated in MongoDB 4.0, and removed in version 4.2.');
}
}

0 comments on commit a3408e6

Please sign in to comment.