declare module 'mongoose' { import mongodb = require('mongodb'); export interface DiscriminatorOptions { value?: string | number | ObjectId; clone?: boolean; overwriteModels?: boolean; mergeHooks?: boolean; mergePlugins?: boolean; } export interface AcceptsDiscriminator { /** Adds a discriminator type. */ discriminator( name: string | number, schema: Schema, value?: string | number | ObjectId | DiscriminatorOptions ): Model; discriminator( name: string | number, schema: Schema, value?: string | number | ObjectId | DiscriminatorOptions ): U; } interface MongooseBulkWriteOptions extends mongodb.BulkWriteOptions { session?: ClientSession; skipValidation?: boolean; throwOnValidationError?: boolean; strict?: boolean | 'throw'; /** When false, do not add timestamps to documents. Can be overridden at the operation level. */ timestamps?: boolean; } interface MongooseBulkSaveOptions extends mongodb.BulkWriteOptions { timestamps?: boolean; session?: ClientSession; } /** * @deprecated use AnyBulkWriteOperation instead */ interface MongooseBulkWritePerWriteOptions { timestamps?: boolean; strict?: boolean | 'throw'; session?: ClientSession; skipValidation?: boolean; } interface HydrateOptions { setters?: boolean; hydratedPopulatedDocs?: boolean; } interface InsertManyOptions extends PopulateOption, SessionOption { limit?: number; // @deprecated, use includeResultMetadata instead rawResult?: boolean; includeResultMetadata?: boolean; ordered?: boolean; lean?: boolean; throwOnValidationError?: boolean; } type InsertManyResult = mongodb.InsertManyResult & { insertedIds: { [key: number]: InferId; }; mongoose?: { validationErrors?: Array }; }; type UpdateWriteOpResult = mongodb.UpdateResult; interface MapReduceOptions { map: Function | string; reduce: (key: K, vals: T[]) => R; /** query filter object. */ query?: any; /** sort input objects using this key */ sort?: any; /** max number of documents */ limit?: number; /** keep temporary data default: false */ keeptemp?: boolean; /** finalize function */ finalize?: (key: K, val: R) => R; /** scope variables exposed to map/reduce/finalize during execution */ scope?: any; /** it is possible to make the execution stay in JS. Provided in MongoDB > 2.0.X default: false */ jsMode?: boolean; /** provide statistics on job execution time. default: false */ verbose?: boolean; readPreference?: string; /** sets the output target for the map reduce job. default: {inline: 1} */ out?: { /** the results are returned in an array */ inline?: number; /** * {replace: 'collectionName'} add the results to collectionName: the * results replace the collection */ replace?: string; /** * {reduce: 'collectionName'} add the results to collectionName: if * dups are detected, uses the reducer / finalize functions */ reduce?: string; /** * {merge: 'collectionName'} add the results to collectionName: if * dups exist the new docs overwrite the old */ merge?: string; }; } interface GeoSearchOptions { /** x,y point to search for */ near: number[]; /** the maximum distance from the point near that a result can be */ maxDistance: number; /** The maximum number of results to return */ limit?: number; /** return the raw object instead of the Mongoose Model */ lean?: boolean; } interface ModifyResult { value: Require_id | null; /** see https://www.mongodb.com/docs/manual/reference/command/findAndModify/#lasterrorobject */ lastErrorObject?: { updatedExisting?: boolean; upserted?: mongodb.ObjectId; }; ok: 0 | 1; } type WriteConcern = mongodb.WriteConcern; /** A list of paths to validate. If set, Mongoose will validate only the modified paths that are in the given list. */ type PathsToValidate = string[] | string; /** * @deprecated */ type pathsToValidate = PathsToValidate; interface SaveOptions extends SessionOption { checkKeys?: boolean; j?: boolean; safe?: boolean | WriteConcern; timestamps?: boolean | QueryTimestampsConfig; validateBeforeSave?: boolean; validateModifiedOnly?: boolean; w?: number | string; wtimeout?: number; } interface CreateOptions extends SaveOptions { ordered?: boolean; aggregateErrors?: boolean; } interface RemoveOptions extends SessionOption, Omit {} const Model: Model; export type AnyBulkWriteOperation = { insertOne: InsertOneModel; } | { replaceOne: ReplaceOneModel; } | { updateOne: UpdateOneModel; } | { updateMany: UpdateManyModel; } | { deleteOne: DeleteOneModel; } | { deleteMany: DeleteManyModel; }; export interface InsertOneModel { document: mongodb.OptionalId; /** When false, do not add timestamps. When true, overrides the `timestamps` option set in the `bulkWrite` options. */ timestamps?: boolean; } export interface ReplaceOneModel { /** The filter to limit the replaced document. */ filter: FilterQuery; /** The document with which to replace the matched document. */ replacement: mongodb.WithoutId; /** Specifies a collation. */ collation?: mongodb.CollationOptions; /** The index to use. If specified, then the query system will only consider plans using the hinted index. */ hint?: mongodb.Hint; /** When true, creates a new document if no document matches the query. */ upsert?: boolean; /** When false, do not add timestamps. When true, overrides the `timestamps` option set in the `bulkWrite` options. */ timestamps?: boolean; } export interface UpdateOneModel { /** The filter to limit the updated documents. */ filter: FilterQuery; /** A document or pipeline containing update operators. */ update: UpdateQuery; /** A set of filters specifying to which array elements an update should apply. */ arrayFilters?: AnyObject[]; /** Specifies a collation. */ collation?: mongodb.CollationOptions; /** The index to use. If specified, then the query system will only consider plans using the hinted index. */ hint?: mongodb.Hint; /** When true, creates a new document if no document matches the query. */ upsert?: boolean; /** When false, do not add timestamps. When true, overrides the `timestamps` option set in the `bulkWrite` options. */ timestamps?: boolean; } export interface UpdateManyModel { /** The filter to limit the updated documents. */ filter: FilterQuery; /** A document or pipeline containing update operators. */ update: UpdateQuery; /** A set of filters specifying to which array elements an update should apply. */ arrayFilters?: AnyObject[]; /** Specifies a collation. */ collation?: mongodb.CollationOptions; /** The index to use. If specified, then the query system will only consider plans using the hinted index. */ hint?: mongodb.Hint; /** When true, creates a new document if no document matches the query. */ upsert?: boolean; /** When false, do not add timestamps. When true, overrides the `timestamps` option set in the `bulkWrite` options. */ timestamps?: boolean; } export interface DeleteOneModel { /** The filter to limit the deleted documents. */ filter: FilterQuery; /** Specifies a collation. */ collation?: mongodb.CollationOptions; /** The index to use. If specified, then the query system will only consider plans using the hinted index. */ hint?: mongodb.Hint; } export interface DeleteManyModel { /** The filter to limit the deleted documents. */ filter: FilterQuery; /** Specifies a collation. */ collation?: mongodb.CollationOptions; /** The index to use. If specified, then the query system will only consider plans using the hinted index. */ hint?: mongodb.Hint; } /** * Models are fancy constructors compiled from `Schema` definitions. * An instance of a model is called a document. * Models are responsible for creating and reading documents from the underlying MongoDB database */ export interface Model< TRawDocType, TQueryHelpers = {}, TInstanceMethods = {}, TVirtuals = {}, THydratedDocumentType = HydratedDocument, TSchema = any> extends NodeJS.EventEmitter, AcceptsDiscriminator, IndexManager, SessionStarter { new >(doc?: DocType, fields?: any | null, options?: boolean | AnyObject): THydratedDocumentType; aggregate(pipeline?: PipelineStage[], options?: AggregateOptions): Aggregate>; aggregate(pipeline: PipelineStage[]): Aggregate>; /** Base Mongoose instance the model uses. */ base: Mongoose; /** * If this is a discriminator model, `baseModelName` is the name of * the base model. */ baseModelName: string | undefined; /* Cast the given POJO to the model's schema */ castObject(obj: AnyObject, options?: { ignoreCastErrors?: boolean }): TRawDocType; /* Apply defaults to the given document or POJO. */ applyDefaults(obj: AnyObject): AnyObject; applyDefaults(obj: TRawDocType): TRawDocType; /** * Sends multiple `insertOne`, `updateOne`, `updateMany`, `replaceOne`, * `deleteOne`, and/or `deleteMany` operations to the MongoDB server in one * command. This is faster than sending multiple independent operations (e.g. * if you use `create()`) because with `bulkWrite()` there is only one network * round trip to the MongoDB server. */ bulkWrite( writes: Array>, options: MongooseBulkWriteOptions & { ordered: false } ): Promise; bulkWrite( writes: Array>, options?: MongooseBulkWriteOptions ): Promise; /** * Sends multiple `save()` calls in a single `bulkWrite()`. This is faster than * sending multiple `save()` calls because with `bulkSave()` there is only one * network round trip to the MongoDB server. */ bulkSave(documents: Array, options?: MongooseBulkSaveOptions): Promise; /** Collection the model uses. */ collection: Collection; /** Creates a `countDocuments` query: counts the number of documents that match `filter`. */ countDocuments( filter?: FilterQuery, options?: (mongodb.CountOptions & MongooseBaseQueryOptions) | null ): QueryWithHelpers< number, THydratedDocumentType, TQueryHelpers, TRawDocType, 'countDocuments', TInstanceMethods >; /** Creates a new document or documents */ create>(docs: Array, options: CreateOptions & { aggregateErrors: true }): Promise<(THydratedDocumentType | Error)[]>; create>(docs: Array, options?: CreateOptions): Promise; create>(doc: DocContents | TRawDocType): Promise; create>(...docs: Array): Promise; /** * Create the collection for this model. By default, if no indexes are specified, * mongoose will not create the collection for the model until any documents are * created. Use this method to create the collection explicitly. */ createCollection(options?: mongodb.CreateCollectionOptions & Pick): Promise>; /** * Create an [Atlas search index](https://www.mongodb.com/docs/atlas/atlas-search/create-index/). * This function only works when connected to MongoDB Atlas. */ createSearchIndex(description: SearchIndexDescription): Promise; /** Connection the model uses. */ db: Connection; /** * Deletes all of the documents that match `conditions` from the collection. * Behaves like `remove()`, but deletes all documents that match `conditions` * regardless of the `single` option. */ deleteMany( filter?: FilterQuery, options?: (mongodb.DeleteOptions & MongooseBaseQueryOptions) | null ): QueryWithHelpers< mongodb.DeleteResult, THydratedDocumentType, TQueryHelpers, TRawDocType, 'deleteMany', TInstanceMethods >; deleteMany( filter: FilterQuery ): QueryWithHelpers< mongodb.DeleteResult, THydratedDocumentType, TQueryHelpers, TRawDocType, 'deleteMany', TInstanceMethods >; /** * Deletes the first document that matches `conditions` from the collection. * Behaves like `remove()`, but deletes at most one document regardless of the * `single` option. */ deleteOne( filter?: FilterQuery, options?: (mongodb.DeleteOptions & MongooseBaseQueryOptions) | null ): QueryWithHelpers< mongodb.DeleteResult, THydratedDocumentType, TQueryHelpers, TRawDocType, 'deleteOne', TInstanceMethods >; deleteOne( filter: FilterQuery ): QueryWithHelpers< mongodb.DeleteResult, THydratedDocumentType, TQueryHelpers, TRawDocType, 'deleteOne', TInstanceMethods >; /** * Delete an existing [Atlas search index](https://www.mongodb.com/docs/atlas/atlas-search/create-index/) by name. * This function only works when connected to MongoDB Atlas. */ dropSearchIndex(name: string): Promise; /** * Event emitter that reports any errors that occurred. Useful for global error * handling. */ events: NodeJS.EventEmitter; /** * Finds a single document by its _id field. `findById(id)` is almost* * equivalent to `findOne({ _id: id })`. If you want to query by a document's * `_id`, use `findById()` instead of `findOne()`. */ findById( id: any, projection: ProjectionType | null | undefined, options: QueryOptions & { lean: true } ): QueryWithHelpers< GetLeanResultType | null, ResultDoc, TQueryHelpers, TRawDocType, 'findOne', TInstanceMethods >; findById( id: any, projection?: ProjectionType | null, options?: QueryOptions | null ): QueryWithHelpers; findById( id: any, projection?: ProjectionType | null ): QueryWithHelpers; /** Finds one document. */ findOne( filter: FilterQuery, projection: ProjectionType | null | undefined, options: QueryOptions & { lean: true } ): QueryWithHelpers< GetLeanResultType | null, ResultDoc, TQueryHelpers, TRawDocType, 'findOne', TInstanceMethods >; findOne( filter?: FilterQuery, projection?: ProjectionType | null, options?: QueryOptions | null ): QueryWithHelpers; findOne( filter?: FilterQuery, projection?: ProjectionType | null ): QueryWithHelpers; findOne( filter?: FilterQuery ): QueryWithHelpers; /** * Shortcut for creating a new Document from existing raw data, pre-saved in the DB. * The document returned has no paths marked as modified initially. */ hydrate(obj: any, projection?: AnyObject, options?: HydrateOptions): THydratedDocumentType; /** * This function is responsible for building [indexes](https://www.mongodb.com/docs/manual/indexes/), * unless [`autoIndex`](http://mongoosejs.com/docs/guide.html#autoIndex) is turned off. * Mongoose calls this function automatically when a model is created using * [`mongoose.model()`](/docs/api/mongoose.html#mongoose_Mongoose-model) or * [`connection.model()`](/docs/api/connection.html#connection_Connection-model), so you * don't need to call it. */ init(): Promise; /** Inserts one or more new documents as a single `insertMany` call to the MongoDB server. */ insertMany( docs: Array ): Promise>; insertMany( docs: Array, options: InsertManyOptions & { lean: true; } ): Promise>>; insertMany( doc: Array, options: InsertManyOptions & { ordered: false; rawResult: true; } ): Promise> & { mongoose: { validationErrors: (CastError | Error.ValidatorError)[]; results: Array< Error | Object | THydratedDocumentType > } }>; insertMany( docs: Array, options: InsertManyOptions & { lean: true, rawResult: true; } ): Promise>>; insertMany( docs: Array, options: InsertManyOptions & { rawResult: true; } ): Promise>>; insertMany( doc: Array, options: InsertManyOptions ): Promise>; insertMany( docs: Array, options: InsertManyOptions & { lean: true; } ): Promise>>; insertMany( docs: DocContents | TRawDocType, options: InsertManyOptions & { lean: true; } ): Promise>>; insertMany( doc: DocContents | TRawDocType, options: InsertManyOptions & { ordered: false; rawResult: true; } ): Promise> & { mongoose: { validationErrors: (CastError | Error.ValidatorError)[]; results: Array< Error | Object | MergeType > } }>; insertMany( docs: Array, options: InsertManyOptions & { rawResult: true; } ): Promise>>; insertMany( docs: Array ): Promise>>>; insertMany( doc: DocContents, options: InsertManyOptions & { lean: true; } ): Promise>>; insertMany( doc: DocContents, options: InsertManyOptions & { rawResult: true; } ): Promise>>; insertMany( doc: DocContents, options: InsertManyOptions ): Promise>>>; insertMany( docs: Array, options: InsertManyOptions ): Promise>>>; insertMany( doc: DocContents ): Promise< Array>> >; /** * List all [Atlas search indexes](https://www.mongodb.com/docs/atlas/atlas-search/create-index/) on this model's collection. * This function only works when connected to MongoDB Atlas. */ listSearchIndexes(options?: mongodb.ListSearchIndexesOptions): Promise>; /** The name of the model */ modelName: string; /** Populates document references. */ populate( docs: Array, options: PopulateOptions | Array | string ): Promise>; populate( doc: any, options: PopulateOptions | Array | string ): Promise; populate( docs: Array, options: PopulateOptions | Array | string ): Promise>>; populate( doc: any, options: PopulateOptions | Array | string ): Promise>; /** * Update an existing [Atlas search index](https://www.mongodb.com/docs/atlas/atlas-search/create-index/). * This function only works when connected to MongoDB Atlas. */ updateSearchIndex(name: string, definition: AnyObject): Promise; /** Casts and validates the given object against this model's schema, passing the given `context` to custom validators. */ validate(): Promise; validate(obj: any): Promise; validate(obj: any, pathsOrOptions: PathsToValidate): Promise; validate(obj: any, pathsOrOptions: { pathsToSkip?: pathsToSkip }): Promise; /** Watches the underlying collection for changes using [MongoDB change streams](https://www.mongodb.com/docs/manual/changeStreams/). */ watch(pipeline?: Array>, options?: mongodb.ChangeStreamOptions & { hydrate?: boolean }): mongodb.ChangeStream; /** Adds a `$where` clause to this query */ $where(argument: string | Function): QueryWithHelpers, THydratedDocumentType, TQueryHelpers, TRawDocType, 'find', TInstanceMethods>; /** Registered discriminators for this model. */ discriminators: { [name: string]: Model } | undefined; /** Translate any aliases fields/conditions so the final query or document object is pure */ translateAliases(raw: any): any; /** Creates a `distinct` query: returns the distinct values of the given `field` that match `filter`. */ distinct( field: DocKey, filter?: FilterQuery ): QueryWithHelpers< Array : ResultType>, THydratedDocumentType, TQueryHelpers, TRawDocType, 'distinct', TInstanceMethods >; /** Creates a `estimatedDocumentCount` query: counts the number of documents in the collection. */ estimatedDocumentCount(options?: QueryOptions): QueryWithHelpers< number, THydratedDocumentType, TQueryHelpers, TRawDocType, 'estimatedDocumentCount', TInstanceMethods >; /** * Returns a document with its `_id` if at least one document exists in the database that matches * the given `filter`, and `null` otherwise. */ exists( filter: FilterQuery ): QueryWithHelpers< { _id: InferId } | null, THydratedDocumentType, TQueryHelpers, TRawDocType, 'findOne', TInstanceMethods >; /** Creates a `find` query: gets a list of documents that match `filter`. */ find( filter: FilterQuery, projection: ProjectionType | null | undefined, options: QueryOptions & { lean: true } ): QueryWithHelpers< GetLeanResultType, ResultDoc, TQueryHelpers, TRawDocType, 'find', TInstanceMethods >; find( filter: FilterQuery, projection?: ProjectionType | null | undefined, options?: QueryOptions | null | undefined ): QueryWithHelpers, ResultDoc, TQueryHelpers, TRawDocType, 'find', TInstanceMethods>; find( filter: FilterQuery, projection?: ProjectionType | null | undefined ): QueryWithHelpers, ResultDoc, TQueryHelpers, TRawDocType, 'find', TInstanceMethods>; find( filter: FilterQuery ): QueryWithHelpers, ResultDoc, TQueryHelpers, TRawDocType, 'find', TInstanceMethods>; find( ): QueryWithHelpers, ResultDoc, TQueryHelpers, TRawDocType, 'find', TInstanceMethods>; /** Creates a `findByIdAndDelete` query, filtering by the given `_id`. */ findByIdAndDelete( id: mongodb.ObjectId | any, options: QueryOptions & { lean: true } ): QueryWithHelpers< GetLeanResultType | null, ResultDoc, TQueryHelpers, TRawDocType, 'findOneAndDelete', TInstanceMethods >; findByIdAndDelete( id: mongodb.ObjectId | any, options: QueryOptions & { includeResultMetadata: true } ): QueryWithHelpers, ResultDoc, TQueryHelpers, TRawDocType, 'findOneAndDelete', TInstanceMethods>; findByIdAndDelete( id?: mongodb.ObjectId | any, options?: QueryOptions | null ): QueryWithHelpers; /** Creates a `findOneAndUpdate` query, filtering by the given `_id`. */ findByIdAndUpdate( filter: FilterQuery, update: UpdateQuery, options: QueryOptions & { includeResultMetadata: true, lean: true } ): QueryWithHelpers< ModifyResult, ResultDoc, TQueryHelpers, TRawDocType, 'findOneAndUpdate', TInstanceMethods >; findByIdAndUpdate( id: mongodb.ObjectId | any, update: UpdateQuery, options: QueryOptions & { lean: true } ): QueryWithHelpers< GetLeanResultType | null, ResultDoc, TQueryHelpers, TRawDocType, 'findOneAndUpdate', TInstanceMethods >; findByIdAndUpdate( id: mongodb.ObjectId | any, update: UpdateQuery, options: QueryOptions & { includeResultMetadata: true } ): QueryWithHelpers, ResultDoc, TQueryHelpers, TRawDocType, 'findOneAndUpdate', TInstanceMethods>; findByIdAndUpdate( id: mongodb.ObjectId | any, update: UpdateQuery, options: QueryOptions & { upsert: true } & ReturnsNewDoc ): QueryWithHelpers; findByIdAndUpdate( id?: mongodb.ObjectId | any, update?: UpdateQuery, options?: QueryOptions | null ): QueryWithHelpers; findByIdAndUpdate( id: mongodb.ObjectId | any, update: UpdateQuery ): QueryWithHelpers; /** Creates a `findOneAndDelete` query: atomically finds the given document, deletes it, and returns the document as it was before deletion. */ findOneAndDelete( filter: FilterQuery, options: QueryOptions & { lean: true } ): QueryWithHelpers< GetLeanResultType | null, ResultDoc, TQueryHelpers, TRawDocType, 'findOneAndDelete', TInstanceMethods >; findOneAndDelete( filter: FilterQuery, options: QueryOptions & { includeResultMetadata: true } ): QueryWithHelpers, ResultDoc, TQueryHelpers, TRawDocType, 'findOneAndDelete', TInstanceMethods>; findOneAndDelete( filter?: FilterQuery | null, options?: QueryOptions | null ): QueryWithHelpers; /** Creates a `findOneAndReplace` query: atomically finds the given document and replaces it with `replacement`. */ findOneAndReplace( filter: FilterQuery, replacement: TRawDocType | AnyObject, options: QueryOptions & { lean: true } ): QueryWithHelpers< GetLeanResultType | null, ResultDoc, TQueryHelpers, TRawDocType, 'findOneAndReplace', TInstanceMethods >; findOneAndReplace( filter: FilterQuery, replacement: TRawDocType | AnyObject, options: QueryOptions & { includeResultMetadata: true } ): QueryWithHelpers, ResultDoc, TQueryHelpers, TRawDocType, 'findOneAndReplace', TInstanceMethods>; findOneAndReplace( filter: FilterQuery, replacement: TRawDocType | AnyObject, options: QueryOptions & { upsert: true } & ReturnsNewDoc ): QueryWithHelpers; findOneAndReplace( filter?: FilterQuery, replacement?: TRawDocType | AnyObject, options?: QueryOptions | null ): QueryWithHelpers; /** Creates a `findOneAndUpdate` query: atomically find the first document that matches `filter` and apply `update`. */ findOneAndUpdate( filter: FilterQuery, update: UpdateQuery, options: QueryOptions & { includeResultMetadata: true, lean: true } ): QueryWithHelpers< ModifyResult, ResultDoc, TQueryHelpers, TRawDocType, 'findOneAndUpdate', TInstanceMethods >; findOneAndUpdate( filter: FilterQuery, update: UpdateQuery, options: QueryOptions & { lean: true } ): QueryWithHelpers< GetLeanResultType | null, ResultDoc, TQueryHelpers, TRawDocType, 'findOneAndUpdate', TInstanceMethods >; findOneAndUpdate( filter: FilterQuery, update: UpdateQuery, options: QueryOptions & { includeResultMetadata: true } ): QueryWithHelpers, ResultDoc, TQueryHelpers, TRawDocType, 'findOneAndUpdate', TInstanceMethods>; findOneAndUpdate( filter: FilterQuery, update: UpdateQuery, options: QueryOptions & { upsert: true } & ReturnsNewDoc ): QueryWithHelpers; findOneAndUpdate( filter?: FilterQuery, update?: UpdateQuery, options?: QueryOptions | null ): QueryWithHelpers; /** Creates a `replaceOne` query: finds the first document that matches `filter` and replaces it with `replacement`. */ replaceOne( filter?: FilterQuery, replacement?: TRawDocType | AnyObject, options?: (mongodb.ReplaceOptions & MongooseQueryOptions) | null ): QueryWithHelpers; /** Apply changes made to this model's schema after this model was compiled. */ recompileSchema(): void; /** Schema the model uses. */ schema: Schema; /** Creates a `updateMany` query: updates all documents that match `filter` with `update`. */ updateMany( filter?: FilterQuery, update?: UpdateQuery | UpdateWithAggregationPipeline, options?: (mongodb.UpdateOptions & MongooseUpdateQueryOptions) | null ): QueryWithHelpers; /** Creates a `updateOne` query: updates the first document that matches `filter` with `update`. */ updateOne( filter?: FilterQuery, update?: UpdateQuery | UpdateWithAggregationPipeline, options?: (mongodb.UpdateOptions & MongooseUpdateQueryOptions) | null ): QueryWithHelpers; /** Creates a Query, applies the passed conditions, and returns the Query. */ where( path: string, val?: any ): QueryWithHelpers, ResultDoc, TQueryHelpers, TRawDocType, 'find', TInstanceMethods>; where(obj: object): QueryWithHelpers< Array, ResultDoc, TQueryHelpers, TRawDocType, 'find', TInstanceMethods >; where(): QueryWithHelpers< Array, ResultDoc, TQueryHelpers, TRawDocType, 'find', TInstanceMethods >; } }