Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface Collection<T>

Type parameters

  • T

Hierarchy

  • Collection

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

bulkWrite

count

countDocuments

createIndex

createIndexes

  • createIndexes(indexSpecs: Object[]): Promise<any>
  • createIndexes(indexSpecs: Object[], callback: MongoCallback<any>): void

deleteMany

deleteOne

distinct

drop

dropIndex

dropIndexes

  • dropIndexes(): Promise<any>
  • dropIndexes(callback?: MongoCallback<any>): void

find

findOne

findOneAndDelete

findOneAndReplace

findOneAndUpdate

geoHaystackSearch

geoNear

group

  • group(keys: Object | Array<any> | Function | Code, condition: Object, initial: Object, reduce: Function | Code, finalize: Function | Code, command: boolean, callback: MongoCallback<any>): void
  • group(keys: Object | Array<any> | Function | Code, condition: Object, initial: Object, reduce: Function | Code, finalize: Function | Code, command: boolean, options?: GroupOptions): Promise<any>
  • group(keys: Object | Array<any> | Function | Code, condition: Object, initial: Object, reduce: Function | Code, finalize: Function | Code, command: boolean, options: GroupOptions, callback: MongoCallback<any>): void
  • Parameters

    • keys: Object | Array<any> | Function | Code

      An object, array or function expressing the keys to group by.

    • condition: Object

      An optional condition that must be true for a row to be considered.

    • initial: Object

      Initial value of the aggregation counter object.

    • reduce: Function | Code

      The reduce function aggregates (reduces) the objects iterated.

    • finalize: Function | Code

      An optional function to be run on each item in the result set just before the item is returned.

    • command: boolean

      Specify if you wish to run using the internal group command or using eval, default is true.

    • callback: MongoCallback<any>

      The command result callback.

    Returns void

  • Parameters

    • keys: Object | Array<any> | Function | Code

      An object, array or function expressing the keys to group by.

    • condition: Object

      An optional condition that must be true for a row to be considered.

    • initial: Object

      Initial value of the aggregation counter object.

    • reduce: Function | Code

      The reduce function aggregates (reduces) the objects iterated.

    • finalize: Function | Code

      An optional function to be run on each item in the result set just before the item is returned.

    • command: boolean

      Specify if you wish to run using the internal group command or using eval, default is true.

    • Optional options: GroupOptions

      Optional.

    Returns Promise<any>

  • Parameters

    • keys: Object | Array<any> | Function | Code

      An object, array or function expressing the keys to group by.

    • condition: Object

      An optional condition that must be true for a row to be considered.

    • initial: Object

      Initial value of the aggregation counter object.

    • reduce: Function | Code

      The reduce function aggregates (reduces) the objects iterated.

    • finalize: Function | Code

      An optional function to be run on each item in the result set just before the item is returned.

    • command: boolean

      Specify if you wish to run using the internal group command or using eval, default is true.

    • options: GroupOptions

      Optional settings.

    • callback: MongoCallback<any>

      The command result callback.

    Returns void

indexExists

  • indexExists(indexes: string | string[]): Promise<boolean>
  • indexExists(indexes: string | string[], callback: MongoCallback<boolean>): void

indexInformation

  • indexInformation(callback: MongoCallback<any>): void
  • indexInformation(options?: object): Promise<any>
  • indexInformation(options: object, callback: MongoCallback<any>): void

indexes

  • indexes(): Promise<any>
  • indexes(callback: MongoCallback<any>): void

initializeOrderedBulkOp

initializeUnorderedBulkOp

insert

insertMany

insertOne

isCapped

  • isCapped(): Promise<any>
  • isCapped(callback: MongoCallback<any>): void

listIndexes

mapReduce

  • mapReduce(map: Function | string, reduce: Function | string, callback: MongoCallback<any>): void
  • mapReduce(map: Function | string, reduce: Function | string, options?: MapReduceOptions): Promise<any>
  • mapReduce(map: Function | string, reduce: Function | string, options: MapReduceOptions, callback: MongoCallback<any>): void

options

  • options(): Promise<any>
  • options(callback: MongoCallback<any>): void

parallelCollectionScan

reIndex

  • reIndex(): Promise<any>
  • reIndex(callback: MongoCallback<any>): void

remove

rename

replaceOne

save

stats

update

updateMany

updateOne

watch

Generated using TypeDoc