class GridFSBucket extends Object
GridFS Bucket
- Annotations
- @RawJSType() @native() @JSImport( "mongodb" , "GridFSBucket" )
- Alphabetic
- By Inheritance
- GridFSBucket
- Object
- Any
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
-
new
GridFSBucket(db: Db, options: |[GridFSOptions, RawOptions] = js.native)
Constructor for a streaming GridFS interface
Constructor for a streaming GridFS interface
- db
the Db
- options
the options
- returns
a new GridFSBucket
- new GridFSBucket()
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
def
delete(id: ObjectID, callback: MongoCallback0 = js.native): Promise[Unit]
Deletes a file with the given id
Deletes a file with the given id
- id
the id of the file doc
- callback
the optional callback function
- returns
a completion promise if no callback function was passed
delete(id[, callback])
Example: -
def
drop(callback: MongoCallback0 = js.native): Promise[Unit]
Removes this bucket's files collection, followed by its chunks collection.
Removes this bucket's files collection, followed by its chunks collection.
- callback
the optional callback function
- returns
a completion promise if no callback function was passed
drop(callback)
Example: -
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
def
find[T](filter: Any, options: |[GridFSBucketFindOptions, RawOptions] = js.native): Cursor[T]
Convenience wrapper around find on the files collection
Convenience wrapper around find on the files collection
find(filter, options)
Example: -
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
-
def
hasOwnProperty(v: String): Boolean
- Definition Classes
- Object
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
isPrototypeOf(v: Object): Boolean
- Definition Classes
- Object
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
-
def
openDownloadStream(id: |[|[ObjectID, String], Int], options: |[DownloadStreamOptions, RawOptions] = js.native): GridFSBucketReadStream
Returns a readable stream (GridFSBucketReadStream) for streaming file data from GridFS.
Returns a readable stream (GridFSBucketReadStream) for streaming file data from GridFS.
- id
the id of the file document
- options
the download options
openDownloadStream(id, options)
Example: -
def
openDownloadStreamByName(filename: String, options: |[DownloadStreamByNameOptions, RawOptions] = js.native): GridFSBucketReadStream
Returns a readable stream (GridFSBucketReadStream) for streaming the file with the given name from GridFS.
Returns a readable stream (GridFSBucketReadStream) for streaming the file with the given name from GridFS. If there are multiple files with the same name, this will stream the most recent file with the given name (as determined by the uploadDate field). You can set the revision option to change this behavior.
- filename
the name of the file to download
- options
the download options
bucket.openDownloadStreamByName('meistersinger.mp3')
Example: -
def
openUploadStream(filename: String, options: |[UploadStreamOptions, RawOptions] = js.native): GridFSBucketWriteStream
Returns a writable stream (GridFSBucketWriteStream) for writing buffers to GridFS.
Returns a writable stream (GridFSBucketWriteStream) for writing buffers to GridFS. The stream's 'id' property contains the resulting file's id.
- filename
the name of the file to download
- options
the upload options
- returns
bucket.openUploadStream('./meistersinger.mp3')
Example: -
def
openUploadStreamWithId(id: |[|[ObjectID, String], Int], filename: String, options: |[UploadStreamOptions, RawOptions] = js.native): GridFSBucketWriteStream
Returns a writable stream (GridFSBucketWriteStream) for writing buffers to GridFS for a custom file id.
Returns a writable stream (GridFSBucketWriteStream) for writing buffers to GridFS for a custom file id. The stream's 'id' property contains the resulting file's id.
- id
A custom id used to identify the file
- filename
The value of the 'filename' key in the files doc
- options
Optional settings.
- returns
-
def
propertyIsEnumerable(v: String): Boolean
- Definition Classes
- Object
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toLocaleString(): String
- Definition Classes
- Object
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
def
valueOf(): Any
- Definition Classes
- Object
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )