Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface ExtendedCollection<TSchema>

Basically MongoDB collection, with some additional properties and methods.

Type parameters

  • TSchema

Hierarchy

  • Collection<TSchema>
    • ExtendedCollection

Index

Properties

collectionName

collectionName: string

Get the collection name.

hint

hint: any

Get current index hint for collection.

namespace

namespace: string

Get the full collection namespace.

readConcern

readConcern: ReadConcern

The current read concern values.

writeConcern

writeConcern: WriteConcern

The current write concern values.

Methods

aggregate

  • aggregate<T>(callback: MongoCallback<AggregationCursor<T>>): AggregationCursor<T>
  • aggregate<T>(pipeline: object[], callback: MongoCallback<AggregationCursor<T>>): AggregationCursor<T>
  • aggregate<T>(pipeline?: object[], options?: CollectionAggregationOptions, callback?: MongoCallback<AggregationCursor<T>>): AggregationCursor<T>

attachHook

bulkWrite

  • bulkWrite(operations: Array<BulkWriteOperation<TSchema>>, callback: MongoCallback<BulkWriteOpResultObject>): void
  • bulkWrite(operations: Array<BulkWriteOperation<TSchema>>, options?: CollectionBulkWriteOptions): Promise<BulkWriteOpResultObject>
  • bulkWrite(operations: Array<BulkWriteOperation<TSchema>>, options: CollectionBulkWriteOptions, callback: MongoCallback<BulkWriteOpResultObject>): void

count

  • count(callback: MongoCallback<number>): void
  • count(query: FilterQuery<TSchema>, callback: MongoCallback<number>): void
  • count(query?: FilterQuery<TSchema>, options?: MongoCountPreferences): Promise<number>
  • count(query: FilterQuery<TSchema>, options: MongoCountPreferences, callback: MongoCallback<number>): void
  • deprecated

    Use countDocuments or estimatedDocumentCount

    Parameters

    • callback: MongoCallback<number>

    Returns void

  • Parameters

    • query: FilterQuery<TSchema>
    • callback: MongoCallback<number>

    Returns void

  • Parameters

    • Optional query: FilterQuery<TSchema>
    • Optional options: MongoCountPreferences

    Returns Promise<number>

  • Parameters

    • query: FilterQuery<TSchema>
    • options: MongoCountPreferences
    • callback: MongoCallback<number>

    Returns void

countDocuments

  • countDocuments(callback: MongoCallback<number>): void
  • countDocuments(query: FilterQuery<TSchema>, callback: MongoCallback<number>): void
  • countDocuments(query?: FilterQuery<TSchema>, options?: MongoCountPreferences): Promise<number>
  • countDocuments(query: FilterQuery<TSchema>, options: MongoCountPreferences, callback: MongoCallback<number>): void

createIndex

  • createIndex(fieldOrSpec: string | any, callback: MongoCallback<string>): void
  • createIndex(fieldOrSpec: string | any, options?: IndexOptions): Promise<string>
  • createIndex(fieldOrSpec: string | any, options: IndexOptions, callback: MongoCallback<string>): void

createIndexes

  • createIndexes(indexSpecs: IndexSpecification[], callback: MongoCallback<any>): void
  • createIndexes(indexSpecs: IndexSpecification[], options?: { session?: ClientSession }): Promise<any>
  • createIndexes(indexSpecs: IndexSpecification[], options: { session?: ClientSession }, callback: MongoCallback<any>): void

deleteMany

  • deleteMany(filter: FilterQuery<TSchema>, callback: MongoCallback<DeleteWriteOpResultObject>): void
  • deleteMany(filter: FilterQuery<TSchema>, options?: CommonOptions): Promise<DeleteWriteOpResultObject>
  • deleteMany(filter: FilterQuery<TSchema>, options: CommonOptions, callback: MongoCallback<DeleteWriteOpResultObject>): void

deleteOne

  • deleteOne(filter: FilterQuery<TSchema>, callback: MongoCallback<DeleteWriteOpResultObject>): void
  • deleteOne(filter: FilterQuery<TSchema>, options?: CommonOptions & { bypassDocumentValidation?: boolean }): Promise<DeleteWriteOpResultObject>
  • deleteOne(filter: FilterQuery<TSchema>, options: CommonOptions & { bypassDocumentValidation?: boolean }, callback: MongoCallback<DeleteWriteOpResultObject>): void
  • Parameters

    • filter: FilterQuery<TSchema>
    • callback: MongoCallback<DeleteWriteOpResultObject>

    Returns void

  • Parameters

    • filter: FilterQuery<TSchema>
    • Optional options: CommonOptions & { bypassDocumentValidation?: boolean }

    Returns Promise<DeleteWriteOpResultObject>

  • Parameters

    • filter: FilterQuery<TSchema>
    • options: CommonOptions & { bypassDocumentValidation?: boolean }
    • callback: MongoCallback<DeleteWriteOpResultObject>

    Returns void

distinct

  • distinct<Key>(key: Key, callback: MongoCallback<Array<FlattenIfArray<WithId<TSchema>[Key]>>>): void
  • distinct<Key>(key: Key, query: FilterQuery<TSchema>, callback: MongoCallback<Array<FlattenIfArray<WithId<TSchema>[Key]>>>): void
  • distinct<Key>(key: Key, query?: FilterQuery<TSchema>, options?: MongoDistinctPreferences): Promise<Array<FlattenIfArray<WithId<TSchema>[Key]>>>
  • distinct<Key>(key: Key, query: FilterQuery<TSchema>, options: MongoDistinctPreferences, callback: MongoCallback<Array<FlattenIfArray<WithId<TSchema>[Key]>>>): void
  • distinct(key: string, callback: MongoCallback<any[]>): void
  • distinct(key: string, query: FilterQuery<TSchema>, callback: MongoCallback<any[]>): void
  • distinct(key: string, query?: FilterQuery<TSchema>, options?: MongoDistinctPreferences): Promise<any[]>
  • distinct(key: string, query: FilterQuery<TSchema>, options: MongoDistinctPreferences, callback: MongoCallback<any[]>): void
  • Type parameters

    • Key: keyof WithId<TSchema>

    Parameters

    • key: Key
    • callback: MongoCallback<Array<FlattenIfArray<WithId<TSchema>[Key]>>>

    Returns void

  • Type parameters

    • Key: keyof WithId<TSchema>

    Parameters

    • key: Key
    • query: FilterQuery<TSchema>
    • callback: MongoCallback<Array<FlattenIfArray<WithId<TSchema>[Key]>>>

    Returns void

  • Type parameters

    • Key: keyof WithId<TSchema>

    Parameters

    • key: Key
    • Optional query: FilterQuery<TSchema>
    • Optional options: MongoDistinctPreferences

    Returns Promise<Array<FlattenIfArray<WithId<TSchema>[Key]>>>

  • Type parameters

    • Key: keyof WithId<TSchema>

    Parameters

    • key: Key
    • query: FilterQuery<TSchema>
    • options: MongoDistinctPreferences
    • callback: MongoCallback<Array<FlattenIfArray<WithId<TSchema>[Key]>>>

    Returns void

  • Parameters

    • key: string
    • callback: MongoCallback<any[]>

    Returns void

  • Parameters

    • key: string
    • query: FilterQuery<TSchema>
    • callback: MongoCallback<any[]>

    Returns void

  • Parameters

    • key: string
    • Optional query: FilterQuery<TSchema>
    • Optional options: MongoDistinctPreferences

    Returns Promise<any[]>

  • Parameters

    • key: string
    • query: FilterQuery<TSchema>
    • options: MongoDistinctPreferences
    • callback: MongoCallback<any[]>

    Returns void

drop

  • drop(options?: { session: ClientSession }): Promise<any>
  • drop(callback: MongoCallback<any>): void
  • drop(options: { session: ClientSession }, callback: MongoCallback<any>): void

dropIndex

  • dropIndex(indexName: string, callback: MongoCallback<any>): void
  • dropIndex(indexName: string, options?: CommonOptions & { maxTimeMS?: number }): Promise<any>
  • dropIndex(indexName: string, options: CommonOptions & { maxTimeMS?: number }, callback: MongoCallback<any>): void

dropIndexes

  • dropIndexes(options?: { maxTimeMS?: number; session?: ClientSession }): Promise<any>
  • dropIndexes(callback?: MongoCallback<any>): void
  • dropIndexes(options: { maxTimeMS?: number; session?: ClientSession }, callback: MongoCallback<any>): void

estimatedDocumentCount

  • estimatedDocumentCount(callback: MongoCallback<number>): void
  • estimatedDocumentCount(query: FilterQuery<TSchema>, callback: MongoCallback<number>): void
  • estimatedDocumentCount(query?: FilterQuery<TSchema>, options?: MongoCountPreferences): Promise<number>
  • estimatedDocumentCount(query: FilterQuery<TSchema>, options: MongoCountPreferences, callback: MongoCallback<number>): void

find

  • find<T>(query?: FilterQuery<TSchema>): Cursor<T>
  • find<T>(query: FilterQuery<TSchema>, options?: FindOneOptions): Cursor<T>

findOne

  • findOne<T>(filter: FilterQuery<TSchema>, callback: MongoCallback<T | null>): void
  • findOne<T>(filter: FilterQuery<TSchema>, options?: FindOneOptions): Promise<T | null>
  • findOne<T>(filter: FilterQuery<TSchema>, options: FindOneOptions, callback: MongoCallback<T | null>): void

findOneAndDelete

  • findOneAndDelete(filter: FilterQuery<TSchema>, callback: MongoCallback<FindAndModifyWriteOpResultObject<TSchema>>): void
  • findOneAndDelete(filter: FilterQuery<TSchema>, options?: FindOneAndDeleteOption): Promise<FindAndModifyWriteOpResultObject<TSchema>>
  • findOneAndDelete(filter: FilterQuery<TSchema>, options: FindOneAndDeleteOption, callback: MongoCallback<FindAndModifyWriteOpResultObject<TSchema>>): void

findOneAndReplace

  • findOneAndReplace(filter: FilterQuery<TSchema>, replacement: object, callback: MongoCallback<FindAndModifyWriteOpResultObject<TSchema>>): void
  • findOneAndReplace(filter: FilterQuery<TSchema>, replacement: object, options?: FindOneAndReplaceOption): Promise<FindAndModifyWriteOpResultObject<TSchema>>
  • findOneAndReplace(filter: FilterQuery<TSchema>, replacement: object, options: FindOneAndReplaceOption, callback: MongoCallback<FindAndModifyWriteOpResultObject<TSchema>>): void

findOneAndUpdate

  • findOneAndUpdate(filter: FilterQuery<TSchema>, update: UpdateQuery<TSchema> | TSchema, callback: MongoCallback<FindAndModifyWriteOpResultObject<TSchema>>): void
  • findOneAndUpdate(filter: FilterQuery<TSchema>, update: UpdateQuery<TSchema> | TSchema, options?: FindOneAndUpdateOption): Promise<FindAndModifyWriteOpResultObject<TSchema>>
  • findOneAndUpdate(filter: FilterQuery<TSchema>, update: UpdateQuery<TSchema> | TSchema, options: FindOneAndUpdateOption, callback: MongoCallback<FindAndModifyWriteOpResultObject<TSchema>>): void

geoHaystackSearch

  • geoHaystackSearch(x: number, y: number, callback: MongoCallback<any>): void
  • geoHaystackSearch(x: number, y: number, options?: GeoHaystackSearchOptions): Promise<any>
  • geoHaystackSearch(x: number, y: number, options: GeoHaystackSearchOptions, callback: MongoCallback<any>): void

group

  • group(keys: object | any[] | Function | Code, condition: object, initial: object, reduce: Function | Code, finalize: Function | Code, command: boolean, callback: MongoCallback<any>): void
  • group(keys: object | any[] | Function | Code, condition: object, initial: object, reduce: Function | Code, finalize: Function | Code, command: boolean, options?: { readPreference?: ReadPreferenceOrMode; session?: ClientSession }): Promise<any>
  • group(keys: object | any[] | Function | Code, condition: object, initial: object, reduce: Function | Code, finalize: Function | Code, command: boolean, options: { readPreference?: ReadPreferenceOrMode; session?: ClientSession }, callback: MongoCallback<any>): void
  • deprecated

    MongoDB 3.6 or higher no longer supports the group command. We recommend rewriting using the aggregation framework.

    Parameters

    • keys: object | any[] | Function | Code
    • condition: object
    • initial: object
    • reduce: Function | Code
    • finalize: Function | Code
    • command: boolean
    • callback: MongoCallback<any>

    Returns void

  • deprecated

    MongoDB 3.6 or higher no longer supports the group command. We recommend rewriting using the aggregation framework.

    Parameters

    • keys: object | any[] | Function | Code
    • condition: object
    • initial: object
    • reduce: Function | Code
    • finalize: Function | Code
    • command: boolean
    • Optional options: { readPreference?: ReadPreferenceOrMode; session?: ClientSession }
      • Optional readPreference?: ReadPreferenceOrMode
      • Optional session?: ClientSession

    Returns Promise<any>

  • deprecated

    MongoDB 3.6 or higher no longer supports the group command. We recommend rewriting using the aggregation framework.

    Parameters

    • keys: object | any[] | Function | Code
    • condition: object
    • initial: object
    • reduce: Function | Code
    • finalize: Function | Code
    • command: boolean
    • options: { readPreference?: ReadPreferenceOrMode; session?: ClientSession }
      • Optional readPreference?: ReadPreferenceOrMode
      • Optional session?: ClientSession
    • callback: MongoCallback<any>

    Returns void

indexExists

  • indexExists(indexes: string | string[], callback: MongoCallback<boolean>): void
  • indexExists(indexes: string | string[], options?: { session: ClientSession }): Promise<boolean>
  • indexExists(indexes: string | string[], options: { session: ClientSession }, callback: MongoCallback<boolean>): void

indexInformation

  • indexInformation(callback: MongoCallback<any>): void
  • indexInformation(options?: { full: boolean; session: ClientSession }): Promise<any>
  • indexInformation(options: { full: boolean; session: ClientSession }, callback: MongoCallback<any>): void

indexes

  • indexes(options?: { session: ClientSession }): Promise<any>
  • indexes(callback: MongoCallback<any>): void
  • indexes(options: { session?: ClientSession }, callback: MongoCallback<any>): void

initializeOrderedBulkOp

  • initializeOrderedBulkOp(options?: CommonOptions): OrderedBulkOperation

initializeUnorderedBulkOp

  • initializeUnorderedBulkOp(options?: CommonOptions): UnorderedBulkOperation

insert

  • insert(docs: OptionalId<TSchema>, callback: MongoCallback<InsertWriteOpResult<WithId<TSchema>>>): void
  • insert(docs: OptionalId<TSchema>, options?: CollectionInsertOneOptions): Promise<InsertWriteOpResult<WithId<TSchema>>>
  • insert(docs: OptionalId<TSchema>, options: CollectionInsertOneOptions, callback: MongoCallback<InsertWriteOpResult<WithId<TSchema>>>): void
  • deprecated

    Use insertOne, insertMany or bulkWrite

    Parameters

    • docs: OptionalId<TSchema>
    • callback: MongoCallback<InsertWriteOpResult<WithId<TSchema>>>

    Returns void

  • deprecated

    Use insertOne, insertMany or bulkWrite

    Parameters

    • docs: OptionalId<TSchema>
    • Optional options: CollectionInsertOneOptions

    Returns Promise<InsertWriteOpResult<WithId<TSchema>>>

  • deprecated

    Use insertOne, insertMany or bulkWrite

    Parameters

    • docs: OptionalId<TSchema>
    • options: CollectionInsertOneOptions
    • callback: MongoCallback<InsertWriteOpResult<WithId<TSchema>>>

    Returns void

insertMany

  • insertMany(docs: Array<OptionalId<TSchema>>, callback: MongoCallback<InsertWriteOpResult<WithId<TSchema>>>): void
  • insertMany(docs: Array<OptionalId<TSchema>>, options?: CollectionInsertManyOptions): Promise<InsertWriteOpResult<WithId<TSchema>>>
  • insertMany(docs: Array<OptionalId<TSchema>>, options: CollectionInsertManyOptions, callback: MongoCallback<InsertWriteOpResult<WithId<TSchema>>>): void

insertOne

  • insertOne(docs: OptionalId<TSchema>, callback: MongoCallback<InsertOneWriteOpResult<WithId<TSchema>>>): void
  • insertOne(docs: OptionalId<TSchema>, options?: CollectionInsertOneOptions): Promise<InsertOneWriteOpResult<WithId<TSchema>>>
  • insertOne(docs: OptionalId<TSchema>, options: CollectionInsertOneOptions, callback: MongoCallback<InsertOneWriteOpResult<WithId<TSchema>>>): void

isCapped

  • isCapped(options?: { session: ClientSession }): Promise<any>
  • isCapped(callback: MongoCallback<any>): void
  • isCapped(options: { session: ClientSession }, callback: MongoCallback<any>): void

listIndexes

  • listIndexes(options?: { batchSize?: number; readPreference?: ReadPreferenceOrMode; session?: ClientSession }): CommandCursor

mapReduce

  • mapReduce<TKey, TValue>(map: CollectionMapFunction<TSchema> | string, reduce: CollectionReduceFunction<TKey, TValue> | string, callback: MongoCallback<any>): void
  • mapReduce<TKey, TValue>(map: CollectionMapFunction<TSchema> | string, reduce: CollectionReduceFunction<TKey, TValue> | string, options?: MapReduceOptions): Promise<any>
  • mapReduce<TKey, TValue>(map: CollectionMapFunction<TSchema> | string, reduce: CollectionReduceFunction<TKey, TValue> | string, options: MapReduceOptions, callback: MongoCallback<any>): void
  • Type parameters

    • TKey

    • TValue

    Parameters

    • map: CollectionMapFunction<TSchema> | string
    • reduce: CollectionReduceFunction<TKey, TValue> | string
    • callback: MongoCallback<any>

    Returns void

  • Type parameters

    • TKey

    • TValue

    Parameters

    • map: CollectionMapFunction<TSchema> | string
    • reduce: CollectionReduceFunction<TKey, TValue> | string
    • Optional options: MapReduceOptions

    Returns Promise<any>

  • Type parameters

    • TKey

    • TValue

    Parameters

    • map: CollectionMapFunction<TSchema> | string
    • reduce: CollectionReduceFunction<TKey, TValue> | string
    • options: MapReduceOptions
    • callback: MongoCallback<any>

    Returns void

options

  • options(options?: { session: ClientSession }): Promise<any>
  • options(callback: MongoCallback<any>): void
  • options(options: { session: ClientSession }, callback: MongoCallback<any>): void

parallelCollectionScan

  • parallelCollectionScan(callback: MongoCallback<Array<Cursor<any>>>): void
  • parallelCollectionScan(options?: ParallelCollectionScanOptions): Promise<Array<Cursor<any>>>
  • parallelCollectionScan(options: ParallelCollectionScanOptions, callback: MongoCallback<Array<Cursor<any>>>): void

reIndex

  • reIndex(options?: { session: ClientSession }): Promise<any>
  • reIndex(callback: MongoCallback<any>): void
  • reIndex(options: { session: ClientSession }, callback: MongoCallback<any>): void

remove

  • remove(selector: object, callback: MongoCallback<WriteOpResult>): void
  • remove(selector: object, options?: CommonOptions & { single?: boolean }): Promise<WriteOpResult>
  • remove(selector: object, options?: CommonOptions & { single?: boolean }, callback?: MongoCallback<WriteOpResult>): void
  • deprecated

    Use use deleteOne, deleteMany or bulkWrite

    Parameters

    • selector: object
    • callback: MongoCallback<WriteOpResult>

    Returns void

  • deprecated

    Use use deleteOne, deleteMany or bulkWrite

    Parameters

    • selector: object
    • Optional options: CommonOptions & { single?: boolean }

    Returns Promise<WriteOpResult>

  • deprecated

    Use use deleteOne, deleteMany or bulkWrite

    Parameters

    • selector: object
    • Optional options: CommonOptions & { single?: boolean }
    • Optional callback: MongoCallback<WriteOpResult>

    Returns void

rename

  • rename(newName: string, callback: MongoCallback<Collection<TSchema>>): void
  • rename(newName: string, options?: { dropTarget?: boolean; session?: ClientSession }): Promise<Collection<TSchema>>
  • rename(newName: string, options: { dropTarget?: boolean; session?: ClientSession }, callback: MongoCallback<Collection<TSchema>>): void
  • Parameters

    • newName: string
    • callback: MongoCallback<Collection<TSchema>>

    Returns void

  • Parameters

    • newName: string
    • Optional options: { dropTarget?: boolean; session?: ClientSession }
      • Optional dropTarget?: boolean
      • Optional session?: ClientSession

    Returns Promise<Collection<TSchema>>

  • Parameters

    • newName: string
    • options: { dropTarget?: boolean; session?: ClientSession }
      • Optional dropTarget?: boolean
      • Optional session?: ClientSession
    • callback: MongoCallback<Collection<TSchema>>

    Returns void

replaceOne

  • replaceOne(filter: FilterQuery<TSchema>, doc: TSchema, callback: MongoCallback<ReplaceWriteOpResult>): void
  • replaceOne(filter: FilterQuery<TSchema>, doc: TSchema, options?: ReplaceOneOptions): Promise<ReplaceWriteOpResult>
  • replaceOne(filter: FilterQuery<TSchema>, doc: TSchema, options: ReplaceOneOptions, callback: MongoCallback<ReplaceWriteOpResult>): void

save

  • save(doc: TSchema, callback: MongoCallback<WriteOpResult>): void
  • save(doc: TSchema, options?: CommonOptions): Promise<WriteOpResult>
  • save(doc: TSchema, options: CommonOptions, callback: MongoCallback<WriteOpResult>): void
  • deprecated

    Use insertOne, insertMany, updateOne or updateMany

    Parameters

    • doc: TSchema
    • callback: MongoCallback<WriteOpResult>

    Returns void

  • deprecated

    Use insertOne, insertMany, updateOne or updateMany

    Parameters

    • doc: TSchema
    • Optional options: CommonOptions

    Returns Promise<WriteOpResult>

  • deprecated

    Use insertOne, insertMany, updateOne or updateMany

    Parameters

    • doc: TSchema
    • options: CommonOptions
    • callback: MongoCallback<WriteOpResult>

    Returns void

stats

  • stats(callback: MongoCallback<CollStats>): void
  • stats(options?: { scale: number; session?: ClientSession }): Promise<CollStats>
  • stats(options: { scale: number; session?: ClientSession }, callback: MongoCallback<CollStats>): void
  • Parameters

    • callback: MongoCallback<CollStats>

    Returns void

  • Parameters

    • Optional options: { scale: number; session?: ClientSession }
      • scale: number
      • Optional session?: ClientSession

    Returns Promise<CollStats>

  • Parameters

    • options: { scale: number; session?: ClientSession }
      • scale: number
      • Optional session?: ClientSession
    • callback: MongoCallback<CollStats>

    Returns void

update

  • update(filter: FilterQuery<TSchema>, update: UpdateQuery<TSchema> | Partial<TSchema>, callback: MongoCallback<WriteOpResult>): void
  • update(filter: FilterQuery<TSchema>, update: UpdateQuery<TSchema> | Partial<TSchema>, options?: UpdateOneOptions & { multi?: boolean }): Promise<WriteOpResult>
  • update(filter: FilterQuery<TSchema>, update: UpdateQuery<TSchema> | Partial<TSchema>, options: UpdateOneOptions & { multi?: boolean }, callback: MongoCallback<WriteOpResult>): void
  • deprecated

    use updateOne, updateMany or bulkWrite

    Parameters

    • filter: FilterQuery<TSchema>
    • update: UpdateQuery<TSchema> | Partial<TSchema>
    • callback: MongoCallback<WriteOpResult>

    Returns void

  • deprecated

    use updateOne, updateMany or bulkWrite

    Parameters

    • filter: FilterQuery<TSchema>
    • update: UpdateQuery<TSchema> | Partial<TSchema>
    • Optional options: UpdateOneOptions & { multi?: boolean }

    Returns Promise<WriteOpResult>

  • deprecated

    use updateOne, updateMany or bulkWrite

    Parameters

    • filter: FilterQuery<TSchema>
    • update: UpdateQuery<TSchema> | Partial<TSchema>
    • options: UpdateOneOptions & { multi?: boolean }
    • callback: MongoCallback<WriteOpResult>

    Returns void

updateMany

  • updateMany(filter: FilterQuery<TSchema>, update: UpdateQuery<TSchema> | Partial<TSchema>, callback: MongoCallback<UpdateWriteOpResult>): void
  • updateMany(filter: FilterQuery<TSchema>, update: UpdateQuery<TSchema> | Partial<TSchema>, options?: UpdateManyOptions): Promise<UpdateWriteOpResult>
  • updateMany(filter: FilterQuery<TSchema>, update: UpdateQuery<TSchema> | Partial<TSchema>, options: UpdateManyOptions, callback: MongoCallback<UpdateWriteOpResult>): void
  • Parameters

    • filter: FilterQuery<TSchema>
    • update: UpdateQuery<TSchema> | Partial<TSchema>
    • callback: MongoCallback<UpdateWriteOpResult>

    Returns void

  • Parameters

    • filter: FilterQuery<TSchema>
    • update: UpdateQuery<TSchema> | Partial<TSchema>
    • Optional options: UpdateManyOptions

    Returns Promise<UpdateWriteOpResult>

  • Parameters

    • filter: FilterQuery<TSchema>
    • update: UpdateQuery<TSchema> | Partial<TSchema>
    • options: UpdateManyOptions
    • callback: MongoCallback<UpdateWriteOpResult>

    Returns void

updateOne

  • updateOne(filter: FilterQuery<TSchema>, update: UpdateQuery<TSchema> | Partial<TSchema>, callback: MongoCallback<UpdateWriteOpResult>): void
  • updateOne(filter: FilterQuery<TSchema>, update: UpdateQuery<TSchema> | Partial<TSchema>, options?: UpdateOneOptions): Promise<UpdateWriteOpResult>
  • updateOne(filter: FilterQuery<TSchema>, update: UpdateQuery<TSchema> | Partial<TSchema>, options: UpdateOneOptions, callback: MongoCallback<UpdateWriteOpResult>): void
  • Parameters

    • filter: FilterQuery<TSchema>
    • update: UpdateQuery<TSchema> | Partial<TSchema>
    • callback: MongoCallback<UpdateWriteOpResult>

    Returns void

  • Parameters

    • filter: FilterQuery<TSchema>
    • update: UpdateQuery<TSchema> | Partial<TSchema>
    • Optional options: UpdateOneOptions

    Returns Promise<UpdateWriteOpResult>

  • Parameters

    • filter: FilterQuery<TSchema>
    • update: UpdateQuery<TSchema> | Partial<TSchema>
    • options: UpdateOneOptions
    • callback: MongoCallback<UpdateWriteOpResult>

    Returns void

watch

  • watch<T>(pipeline?: object[], options?: ChangeStreamOptions & { session?: ClientSession }): ChangeStream<T>