class GridStore extends Object with IEventEmitter
Grid Store
- Annotations
- @RawJSType() @native() @JSImport( "mongodb" , "GridStore" )
- Alphabetic
- By Inheritance
- GridStore
- IEventEmitter
- Object
- Any
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
- new GridStore(db: Db, id: ObjectID, filename: String, mode: String)
- new GridStore(db: Db, id: ObjectID, mode: String)
- new GridStore(db: Db, filename: String, mode: String, options: GridStoreOptions)
- new GridStore(db: Db, filename: String, mode: String)
-
new
GridStore(db: Db, id: UndefOr[ObjectID] = js.native, filename: UndefOr[String] = js.native, mode: String, options: UndefOr[GridStoreOptions] = js.native)
- db
A database instance to interact with.
- id
optional unique id for this file
- filename
optional filename for this file, no unique constrain on the field
- mode
sets the mode for this file.
- options
optional properties to specify.
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
-
def
addListener(eventName: String, listener: Function): GridStore.this.type
- Definition Classes
- IEventEmitter
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
chunkCollection(callback: Function): Unit
Retrieve this file’s chunks collection.
-
var
chunkSize: Integer
Returns the current chunk size of the file.
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
def
close(callback: Function): Unit
Saves this file to the database.
Saves this file to the database. This will overwrite the old entry if it already exists. This will work properly only if mode was initialized to “w” or “w+”.
-
def
collection(callback: Function): Unit
Retrieves the file collection associated with this object.
- val db: Db
-
val
domain: String
- Definition Classes
- IEventEmitter
-
def
emit(name: String, args: Any*): Any
- Definition Classes
- IEventEmitter
-
def
eof(): Boolean
Verify if the file is at EOF.
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- val filename: UndefOr[String]
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
-
def
getMaxListeners(): Int
- Definition Classes
- IEventEmitter
-
def
getc(callback: Function): Unit
Retrieves a single character from this file.
-
def
hasOwnProperty(v: String): Boolean
- Definition Classes
- Object
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- val id: UndefOr[ObjectID]
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
isPrototypeOf(v: Object): Boolean
- Definition Classes
- Object
-
def
listenerCount(eventName: String): Int
- Definition Classes
- IEventEmitter
-
def
listeners(eventName: String): Array[Function]
- Definition Classes
- IEventEmitter
-
var
md5: Integer
The md5 checksum for this file.
- val mode: String
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
-
def
on(eventName: String, listener: Function): GridStore.this.type
- Definition Classes
- IEventEmitter
-
def
once(eventName: String, listener: Function): GridStore.this.type
- Definition Classes
- IEventEmitter
-
def
open(callback: Function): Unit
Opens the file from the database and initialize this object.
Opens the file from the database and initialize this object. Also creates a new one if file does not exist.
- val options: UndefOr[GridStoreOptions]
-
def
propertyIsEnumerable(v: String): Boolean
- Definition Classes
- Object
-
def
puts(string: String, callback: Function): Unit
Writes a string to the file with a newline character appended at the end if the given string does not have one.
Writes a string to the file with a newline character appended at the end if the given string does not have one.
puts(string, callback)
Example: -
def
read(callback: Function): Unit
Retrieves the contents of this file and advances the read/write head.
Retrieves the contents of this file and advances the read/write head. Works with Buffers only.
read([length][, buffer], callback)
Example: -
def
read(buffer: Buffer, callback: Function): Unit
Retrieves the contents of this file and advances the read/write head.
Retrieves the contents of this file and advances the read/write head. Works with Buffers only.
read([length][, buffer], callback)
Example: -
def
read(length: Int, buffer: Buffer, callback: Function): Unit
Retrieves the contents of this file and advances the read/write head.
Retrieves the contents of this file and advances the read/write head. Works with Buffers only.
read([length][, buffer], callback)
Example: -
def
readlines(callback: Function): Unit
Reads the data of this file.
Reads the data of this file.
readlines([separator], callback)
Example: -
def
readlines(separator: String, callback: Function): Unit
Reads the data of this file.
Reads the data of this file.
readlines([separator], callback)
Example: -
def
removeAllListeners(): GridStore.this.type
- Definition Classes
- IEventEmitter
-
def
removeAllListeners(eventName: String): GridStore.this.type
- Definition Classes
- IEventEmitter
-
def
removeListener(eventName: String, listener: Function): GridStore.this.type
- Definition Classes
- IEventEmitter
-
def
rewind(callback: Function): Unit
Deletes all the chunks of this file in the database if mode was set to “w” or “w+” and resets the read/write head to the initial position.
-
def
seek(callback: Function): Unit
Moves the read/write head to a new location.
Moves the read/write head to a new location. Seek Location Modes:
- GridStore.IO_SEEK_SET, (default) set the position from the start of the file.
- GridStore.IO_SEEK_CUR, set the position from the current position in the file.
- GridStore.IO_SEEK_END, set the position from the end of the file.
seek([position][, seekLocation], callback)
Example: -
def
seek(seekLocation: Int, callback: Function): Unit
Moves the read/write head to a new location.
Moves the read/write head to a new location. Seek Location Modes:
- GridStore.IO_SEEK_SET, (default) set the position from the start of the file.
- GridStore.IO_SEEK_CUR, set the position from the current position in the file.
- GridStore.IO_SEEK_END, set the position from the end of the file.
seek([position][, seekLocation], callback)
Example: -
def
seek(position: Int, seekLocation: Int, callback: Function): Unit
Moves the read/write head to a new location.
Moves the read/write head to a new location. Seek Location Modes:
- GridStore.IO_SEEK_SET, (default) set the position from the start of the file.
- GridStore.IO_SEEK_CUR, set the position from the current position in the file.
- GridStore.IO_SEEK_END, set the position from the end of the file.
seek([position][, seekLocation], callback)
Example: -
def
setMaxListeners(n: Int): GridStore.this.type
- Definition Classes
- IEventEmitter
-
def
stream(autoclose: Boolean): GridStoreStream
Returns read stream based on this GridStore file.
Returns read stream based on this GridStore file.
- autoclose
if true current GridStore will be closed when EOF and ‘close’ event will be fired
-
def
stream(): GridStoreStream
Returns read stream based on this GridStore file.
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
tell(): Promise[Int]
Retrieves the position of the read/write head of this file.
Retrieves the position of the read/write head of this file.
tell(length, buffer, callback)
Example: -
def
tell(length: Int, buffer: String): Promise[Int]
Retrieves the position of the read/write head of this file.
Retrieves the position of the read/write head of this file.
- length
the number of characters to read. Reads all the characters from the read/write head to the EOF if not specified (optional).
- buffer
a String or Buffer to hold temporary data. This is used for storing the string data read so far when recursively calling this method (optional).
tell(length, buffer, callback)
Example: -
def
tell(length: Int, buffer: String, callback: Function2[MongoError, Int, Any]): Unit
Retrieves the position of the read/write head of this file.
Retrieves the position of the read/write head of this file.
- length
the number of characters to read. Reads all the characters from the read/write head to the EOF if not specified (optional).
- buffer
a String or Buffer to hold temporary data. This is used for storing the string data read so far when recursively calling this method (optional).
- callback
the command callback.
tell(length, buffer, callback)
Example: -
def
tell(length: Int, buffer: Buffer): Promise[Int]
Retrieves the position of the read/write head of this file.
Retrieves the position of the read/write head of this file.
- length
the number of characters to read. Reads all the characters from the read/write head to the EOF if not specified (optional).
- buffer
a String or Buffer to hold temporary data. This is used for storing the string data read so far when recursively calling this method (optional).
tell(length, buffer, callback)
Example: -
def
tell(length: Int, buffer: Buffer, callback: Function2[MongoError, Int, Any]): Unit
Retrieves the position of the read/write head of this file.
Retrieves the position of the read/write head of this file.
- length
the number of characters to read. Reads all the characters from the read/write head to the EOF if not specified (optional).
- buffer
a String or Buffer to hold temporary data. This is used for storing the string data read so far when recursively calling this method (optional).
- callback
the command callback.
tell(length, buffer, callback)
Example: -
def
toLocaleString(): String
- Definition Classes
- Object
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
def
unlink(callback: Function): Unit
Deletes all the chunks of this file in the database.
-
val
usingDomains: Boolean
- Definition Classes
- IEventEmitter
-
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( ... )
-
def
write(data: String, callback: Function): Unit
Writes some data.
Writes some data. This method will work properly only if initialized with mode “w” or “w+”.
write(data[, close], callback)
Example: -
def
write(data: Buffer, callback: Function): Unit
Writes some data.
Writes some data. This method will work properly only if initialized with mode “w” or “w+”.
write(data[, close], callback)
Example: -
def
write(data: String, close: Boolean, callback: Function): Unit
Writes some data.
Writes some data. This method will work properly only if initialized with mode “w” or “w+”.
write(data[, close], callback)
Example: -
def
write(data: Buffer, close: Boolean, callback: Function): Unit
Writes some data.
Writes some data. This method will work properly only if initialized with mode “w” or “w+”.
write(data[, close], callback)
Example: -
def
writeFile(file: String, callback: Function): Unit
Stores a file from the file system to the GridFS database.