Constructors
constructor
-
Parameters
-
-
collectionName: string
-
Optional model: Model
Properties
Private collectionName
collectionName: string
Methods
aggregate
- aggregate(pipeline: any[], options?: CollectionAggregationOptions): Promise<AggregationCursor>
-
Parameters
-
pipeline: any[]
-
Optional options: CollectionAggregationOptions
Returns Promise<AggregationCursor>
countDocuments
- countDocuments(filter?: any, options?: MongoCountPreferences): Promise<number>
-
Parameters
-
Optional filter: any
-
Optional options: MongoCountPreferences
Returns Promise<number>
deleteMany
- deleteMany(filter?: any, options?: CommonOptions): Promise<DeleteWriteOpResultObject>
-
Parameters
-
Optional filter: any
-
Optional options: CommonOptions
Returns Promise<DeleteWriteOpResultObject>
deleteOne
- deleteOne(filter?: any, options?: CommonOptions): Promise<DeleteWriteOpResultObject>
-
Parameters
-
Optional filter: any
-
Optional options: CommonOptions
Returns Promise<DeleteWriteOpResultObject>
distinct
- distinct(key: string, filter?: any, options?: undefined | object): Promise<any>
-
Parameters
-
key: string
-
Optional filter: any
-
Optional options: undefined | object
Returns Promise<any>
find
- find(filter?: any, options?: FindOneOptions): Promise<Cursor>
-
Parameters
-
Optional filter: any
-
Optional options: FindOneOptions
Returns Promise<Cursor>
findOne
- findOne(filter?: any, options?: FindOneOptions): Promise<any>
-
Parameters
-
Optional filter: any
-
Optional options: FindOneOptions
Returns Promise<any>
insertMany
- insertMany(data: any[], options?: CollectionInsertManyOptions): Promise<InsertWriteOpResult>
-
Parameters
-
data: any[]
-
Optional options: CollectionInsertManyOptions
Returns Promise<InsertWriteOpResult>
insertOne
- insertOne(data: any, options?: CollectionInsertManyOptions): Promise<InsertOneWriteOpResult>
-
Parameters
-
data: any
-
Optional options: CollectionInsertManyOptions
Returns Promise<InsertOneWriteOpResult>
updateMany
- updateMany(filter?: any, update: any, options?: UpdateManyOptions): Promise<UpdateWriteOpResult>
-
Parameters
-
Default value filter: any = {}
-
update: any
-
Optional options: UpdateManyOptions
Returns Promise<UpdateWriteOpResult>
updateOne
- updateOne(filter?: any, update: any, options?: UpdateManyOptions): Promise<UpdateWriteOpResult>
-
Parameters
-
Default value filter: any = {}
-
update: any
-
Optional options: UpdateManyOptions
Returns Promise<UpdateWriteOpResult>