Skip to content

Commit

Permalink
types(connection): add missing sanitizeFilter option
Browse files Browse the repository at this point in the history
  • Loading branch information
vkarpov15 committed Oct 20, 2024
1 parent 830b010 commit 57b38f8
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions types/connection.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,12 @@ declare module 'mongoose' {
autoIndex?: boolean;
/** Set to `false` to disable Mongoose automatically calling `createCollection()` on every model created on this connection. */
autoCreate?: boolean;
/**
* Sanitizes query filters against [query selector injection attacks](
* https://thecodebarbarian.com/2014/09/04/defending-against-query-selector-injection-attacks.html
* ) by wrapping any nested objects that have a property whose name starts with $ in a $eq.
*/
sanitizeFilter?: boolean;
}

class Connection extends events.EventEmitter implements SessionStarter {
Expand Down

0 comments on commit 57b38f8

Please sign in to comment.