Methods
close
-
Returns void
delete
- delete(id: string): PromiseLike<void>
- delete(id: string, resultHandler: ((res: AsyncResult<void>) => void) | Handler<AsyncResult<void>>): MongoGridFsClient
-
Parameters
Returns PromiseLike<void>
-
Parameters
-
id: string
-
resultHandler: ((res: AsyncResult<void>) => void) | Handler<AsyncResult<void>>
downloadByFileName
- downloadByFileName(stream: WriteStream<Buffer>, fileName: string): PromiseLike<number>
- downloadByFileName(stream: WriteStream<Buffer>, fileName: string, resultHandler: ((res: AsyncResult<number>) => void) | Handler<AsyncResult<number>>): MongoGridFsClient
-
Parameters
-
stream: WriteStream<Buffer>
-
fileName: string
Returns PromiseLike<number>
-
Parameters
-
stream: WriteStream<Buffer>
-
fileName: string
-
resultHandler: ((res: AsyncResult<number>) => void) | Handler<AsyncResult<number>>
downloadByFileNameWithOptions
- downloadByFileNameWithOptions(stream: WriteStream<Buffer>, fileName: string, options: GridFsDownloadOptions): PromiseLike<number>
- downloadByFileNameWithOptions(stream: WriteStream<Buffer>, fileName: string, options: GridFsDownloadOptions, resultHandler: ((res: AsyncResult<number>) => void) | Handler<AsyncResult<number>>): MongoGridFsClient
-
Parameters
-
stream: WriteStream<Buffer>
-
fileName: string
-
Returns PromiseLike<number>
-
Parameters
-
stream: WriteStream<Buffer>
-
fileName: string
-
-
resultHandler: ((res: AsyncResult<number>) => void) | Handler<AsyncResult<number>>
downloadById
- downloadById(stream: WriteStream<Buffer>, id: string): PromiseLike<number>
- downloadById(stream: WriteStream<Buffer>, id: string, resultHandler: ((res: AsyncResult<number>) => void) | Handler<AsyncResult<number>>): MongoGridFsClient
-
Parameters
-
stream: WriteStream<Buffer>
-
id: string
Returns PromiseLike<number>
-
Parameters
-
stream: WriteStream<Buffer>
-
id: string
-
resultHandler: ((res: AsyncResult<number>) => void) | Handler<AsyncResult<number>>
downloadFile
- downloadFile(fileName: string): PromiseLike<number>
- downloadFile(fileName: string, resultHandler: ((res: AsyncResult<number>) => void) | Handler<AsyncResult<number>>): MongoGridFsClient
-
Parameters
Returns PromiseLike<number>
-
Parameters
-
fileName: string
-
resultHandler: ((res: AsyncResult<number>) => void) | Handler<AsyncResult<number>>
downloadFileAs
- downloadFileAs(fileName: string, newFileName: string): PromiseLike<number>
- downloadFileAs(fileName: string, newFileName: string, resultHandler: ((res: AsyncResult<number>) => void) | Handler<AsyncResult<number>>): MongoGridFsClient
-
Parameters
-
fileName: string
-
newFileName: string
Returns PromiseLike<number>
-
Parameters
-
fileName: string
-
newFileName: string
-
resultHandler: ((res: AsyncResult<number>) => void) | Handler<AsyncResult<number>>
downloadFileByID
- downloadFileByID(id: string, fileName: string): PromiseLike<number>
- downloadFileByID(id: string, fileName: string, resultHandler: ((res: AsyncResult<number>) => void) | Handler<AsyncResult<number>>): MongoGridFsClient
-
Parameters
-
id: string
-
fileName: string
Returns PromiseLike<number>
-
Parameters
-
id: string
-
fileName: string
-
resultHandler: ((res: AsyncResult<number>) => void) | Handler<AsyncResult<number>>
drop
- drop(): PromiseLike<void>
- drop(resultHandler: ((res: AsyncResult<void>) => void) | Handler<AsyncResult<void>>): MongoGridFsClient
-
Returns PromiseLike<void>
-
Parameters
-
resultHandler: ((res: AsyncResult<void>) => void) | Handler<AsyncResult<void>>
findAllIds
- findAllIds(): PromiseLike<string>
- findAllIds(resultHandler: ((res: AsyncResult<string>) => void) | Handler<AsyncResult<string>>): MongoGridFsClient
-
Returns PromiseLike<string>
-
Parameters
-
resultHandler: ((res: AsyncResult<string>) => void) | Handler<AsyncResult<string>>
findIds
- findIds(query: {}): PromiseLike<string>
- findIds(query: {}, resultHandler: ((res: AsyncResult<string>) => void) | Handler<AsyncResult<string>>): MongoGridFsClient
-
Parameters
Returns PromiseLike<string>
-
Parameters
-
query: {}
-
resultHandler: ((res: AsyncResult<string>) => void) | Handler<AsyncResult<string>>
readByFileName
- readByFileName(fileName: string): ReadStream<Buffer>
-
Parameters
Returns ReadStream<Buffer>
readByFileNameWithOptions
-
Parameters
Returns ReadStream<Buffer>
readById
- readById(id: string): ReadStream<Buffer>
-
Parameters
Returns ReadStream<Buffer>
uploadByFileName
- uploadByFileName(stream: ReadStream<Buffer>, fileName: string): PromiseLike<string>
- uploadByFileName(stream: ReadStream<Buffer>, fileName: string, resultHandler: ((res: AsyncResult<string>) => void) | Handler<AsyncResult<string>>): MongoGridFsClient
-
Parameters
-
stream: ReadStream<Buffer>
-
fileName: string
Returns PromiseLike<string>
-
Parameters
-
stream: ReadStream<Buffer>
-
fileName: string
-
resultHandler: ((res: AsyncResult<string>) => void) | Handler<AsyncResult<string>>
uploadByFileNameWithOptions
- uploadByFileNameWithOptions(stream: ReadStream<Buffer>, fileName: string, options: GridFsUploadOptions): PromiseLike<string>
- uploadByFileNameWithOptions(stream: ReadStream<Buffer>, fileName: string, options: GridFsUploadOptions, resultHandler: ((res: AsyncResult<string>) => void) | Handler<AsyncResult<string>>): MongoGridFsClient
-
Parameters
-
stream: ReadStream<Buffer>
-
fileName: string
-
Returns PromiseLike<string>
-
Parameters
-
stream: ReadStream<Buffer>
-
fileName: string
-
-
resultHandler: ((res: AsyncResult<string>) => void) | Handler<AsyncResult<string>>
uploadFile
- uploadFile(fileName: string): PromiseLike<string>
- uploadFile(fileName: string, resultHandler: ((res: AsyncResult<string>) => void) | Handler<AsyncResult<string>>): MongoGridFsClient
-
Parameters
Returns PromiseLike<string>
-
Parameters
-
fileName: string
-
resultHandler: ((res: AsyncResult<string>) => void) | Handler<AsyncResult<string>>
uploadFileWithOptions
-
Parameters
Returns PromiseLike<string>
-
Parameters
-
fileName: string
-
-
resultHandler: ((res: AsyncResult<string>) => void) | Handler<AsyncResult<string>>
Close the client and release its resources