reactivemongo.api.gridfs

GridFS

abstract class GridFS[P <: SerializationPack with Singleton] extends AnyRef

A GridFS store.

Self Type
GridFS[P]
Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. GridFS
  2. AnyRef
  3. Any
Implicitly
  1. by any2stringadd
  2. by any2stringfmt
  3. by any2ArrowAssoc
  4. by any2Ensuring
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new GridFS(db: DB with DBMetaCommands, prefix: String = "fs")(implicit producer: GenericCollectionProducer[P, GenericCollection[P]] = ...)

    db

    The database where this store is located.

    prefix

    The prefix of this store. The files and chunks collections will be actually named ${prefix}.files and ${prefix}.chunks.

    Annotations
    @deprecated
    Deprecated

    (Since version 0.19.0) Internal: will be made private

Type Members

  1. type ReadFile[Id <: P.Value] = gridfs.ReadFile[P, Id]

Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. def +(other: String): String

    Implicit information
    This member is added by an implicit conversion from GridFS[P] to StringAdd performed by method any2stringadd in scala.Predef.
    Definition Classes
    StringAdd
  5. def ->[B](y: B): (GridFS[P], B)

    Implicit information
    This member is added by an implicit conversion from GridFS[P] to ArrowAssoc[GridFS[P]] performed by method any2ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @inline()
  6. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  7. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  8. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  9. def chunks(file: ReadFile[P.Value], readPreference: ReadPreference = defaultReadPreference)(implicit ec: ExecutionContext, cp: CursorProducer[Array[Byte]]): ProducedCursor

    Returns a cursor for the chunks of the specified file.

    Returns a cursor for the chunks of the specified file. The cursor walks the chunks orderly.

    Annotations
    @silent( ... )
  10. lazy val chunks: GenericCollection[pack.type]

    The chunks collection

  11. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  12. def defaultReadPreference: ReadPreference

    Annotations
    @inline()
  13. def ensureIndex()(implicit ec: ExecutionContext): Future[Boolean]

    Creates the needed indexes on the GridFS collections (chunks and files).

    Creates the needed indexes on the GridFS collections (chunks and files).

    Please note that you should really consider reading http://www.mongodb.org/display/DOCS/Indexes before doing this, especially in production.

    returns

    A future containing true if the index was created, false if it already exists.

  14. def ensuring(cond: (GridFS[P]) ⇒ Boolean, msg: ⇒ Any): GridFS[P]

    Implicit information
    This member is added by an implicit conversion from GridFS[P] to Ensuring[GridFS[P]] performed by method any2Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  15. def ensuring(cond: (GridFS[P]) ⇒ Boolean): GridFS[P]

    Implicit information
    This member is added by an implicit conversion from GridFS[P] to Ensuring[GridFS[P]] performed by method any2Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  16. def ensuring(cond: Boolean, msg: ⇒ Any): GridFS[P]

    Implicit information
    This member is added by an implicit conversion from GridFS[P] to Ensuring[GridFS[P]] performed by method any2Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  17. def ensuring(cond: Boolean): GridFS[P]

    Implicit information
    This member is added by an implicit conversion from GridFS[P] to Ensuring[GridFS[P]] performed by method any2Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  18. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  19. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  20. def exists(implicit ec: ExecutionContext): Future[Boolean]

    Returns whether the data related to this GridFS instance exists on the database.

  21. def fileToSave(_filename: Option[String] = None, _contentType: Option[String] = None, _uploadDate: Option[Long] = None, _metadata: P.Document = document(Seq.empty)): FileToSave[pack.type, P.Value]

    Prepare the information to save a file.

    Prepare the information to save a file. The unique ID is automatically generated.

  22. lazy val files: GenericCollection[pack.type]

    The files collection

  23. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  24. def find(selector: P.Document)(implicit ec: ExecutionContext, cp: CursorProducer[ReadFile[P.Value]]): ProducedCursor

    Annotations
    @silent( ".*ec\\ .*is\\ never\\ used.*" ) @inline()
  25. def find[S, T <: ReadFile[_]](selector: S)(implicit sWriter: P.Writer[S], readFileReader: P.Reader[T], ec: ExecutionContext, cp: CursorProducer[T]): ProducedCursor

    Finds the files matching the given selector.

    Finds the files matching the given selector.

    S

    The type of the selector document. An implicit Writer[S] must be in the scope.

    selector

    The document to select the files to return

    Annotations
    @silent( ".*ec\\ .*is\\ never\\ used.*" )
  26. def formatted(fmtstr: String): String

    Implicit information
    This member is added by an implicit conversion from GridFS[P] to StringFormat performed by method any2stringfmt in scala.Predef.
    Definition Classes
    StringFormat
    Annotations
    @inline()
  27. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  28. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  29. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  30. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  31. final def notify(): Unit

    Definition Classes
    AnyRef
  32. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  33. def readToOutputStream[Id <: P.Value](file: ReadFile[Id], out: OutputStream)(implicit ec: ExecutionContext): Future[Unit]

    Reads the given file and writes its contents to the given OutputStream

    Reads the given file and writes its contents to the given OutputStream

    Annotations
    @silent( ".*(IdProducer|enumerate).*" )
  34. def remove(id: P.Value)(implicit ec: ExecutionContext): Future[WriteResult]

    Removes a file from this store.

    Removes a file from this store. Note that if the file does not actually exist, the returned future will not be hold an error.

    id

    the file id to remove from this store

    Annotations
    @inline()
  35. def remove[Id <: P.Value](file: BasicMetadata[Id])(implicit ec: ExecutionContext, idProducer: ((String, Id)) ⇒ Producer[BSONElement]): Future[WriteResult]

    Removes a file from this store.

    Removes a file from this store. Note that if the file does not actually exist, the returned future will not be hold an error.

    file

    the file entry to remove from this store

  36. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  37. def toString(): String

    Definition Classes
    GridFS → AnyRef → Any
  38. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  39. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  40. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  41. def writeFromInputStream[Id <: P.Value](file: FileToSave[pack.type, Id], input: InputStream, chunkSize: Int = 262144)(implicit readFileReader: P.Reader[ReadFile[Id]], ec: ExecutionContext, idProducer: ((String, Id)) ⇒ Producer[BSONElement], docWriter: BSONDocumentWriter[P.Document]): Future[ReadFile[Id]]

    Writes the data provided by the given InputStream to the given file.

    Writes the data provided by the given InputStream to the given file.

    Annotations
    @silent( ".*(idProducer|save).*" )
  42. def [B](y: B): (GridFS[P], B)

    Implicit information
    This member is added by an implicit conversion from GridFS[P] to ArrowAssoc[GridFS[P]] performed by method any2ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc

Shadowed Implicit Value Members

  1. val self: Any

    Implicit information
    This member is added by an implicit conversion from GridFS[P] to StringAdd performed by method any2stringadd in scala.Predef.
    Shadowing
    This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
    To access this member you can use a type ascription:
    (gridFS: StringAdd).self
    Definition Classes
    StringAdd
  2. val self: Any

    Implicit information
    This member is added by an implicit conversion from GridFS[P] to StringFormat performed by method any2stringfmt in scala.Predef.
    Shadowing
    This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
    To access this member you can use a type ascription:
    (gridFS: StringFormat).self
    Definition Classes
    StringFormat

Deprecated Value Members

  1. def enumerate[Id <: P.Value](file: ReadFile[Id])(implicit ec: ExecutionContext, idProducer: ((String, Id)) ⇒ Producer[BSONElement]): Enumerator[Array[Byte]]

    Produces an enumerator of chunks of bytes from the chunks collection matching the given file metadata.

    Produces an enumerator of chunks of bytes from the chunks collection matching the given file metadata.

    file

    the file to be read

    Annotations
    @deprecated
    Deprecated

    (Since version 0.17.0) Will be moved to reactivemongo.play.iteratees.GridFS

  2. def iteratee[Id <: P.Value](file: FileToSave[pack.type, Id], chunkSize: Int = 262144)(implicit readFileReader: P.Reader[ReadFile[Id]], ec: ExecutionContext, idProducer: ((String, Id)) ⇒ Producer[BSONElement], docWriter: BSONDocumentWriter[P.Document]): Iteratee[Array[Byte], Future[ReadFile[Id]]]

    Returns an Iteratee that will consume data to put into a GridFS store.

    Returns an Iteratee that will consume data to put into a GridFS store.

    Id

    the type of the id of this file (generally BSONObjectID or BSONValue).

    file

    the metadata of the file to store.

    chunkSize

    Size of the chunks. Defaults to 256kB.

    Annotations
    @deprecated
    Deprecated

    (Since version 0.12.0) Use iterateeWithMD5

  3. def iterateeWithMD5[Id <: P.Value](file: FileToSave[pack.type, Id], chunkSize: Int = 262144)(implicit readFileReader: P.Reader[ReadFile[Id]], ec: ExecutionContext, idProducer: ((String, Id)) ⇒ Producer[BSONElement], docWriter: BSONDocumentWriter[P.Document]): Iteratee[Array[Byte], Future[ReadFile[Id]]]

    Returns an Iteratee that will consume data to put into a GridFS store, computing the MD5.

    Returns an Iteratee that will consume data to put into a GridFS store, computing the MD5.

    Id

    the type of the id of this file (generally BSONObjectID or BSONValue).

    file

    the metadata of the file to store.

    chunkSize

    Size of the chunks. Defaults to 256kB.

    Annotations
    @deprecated
    Deprecated

    (Since version 0.12.0) Will be moved to reactivemongo.play.iteratees.GridFS

  4. lazy val pack: P

    Annotations
    @deprecated
    Deprecated

    (Since version 0.19.0) Internal: will be made private

  5. def save[Id <: P.Value](enumerator: Enumerator[Array[Byte]], file: FileToSave[pack.type, Id], chunkSize: Int = 262144)(implicit readFileReader: P.Reader[ReadFile[Id]], ec: ExecutionContext, idProducer: ((String, Id)) ⇒ Producer[BSONElement], docWriter: BSONDocumentWriter[P.Document]): Future[ReadFile[Id]]

    Saves the content provided by the given enumerator with the given metadata.

    Saves the content provided by the given enumerator with the given metadata.

    enumerator

    Producer of content.

    file

    Metadata of the file to store.

    chunkSize

    Size of the chunks. Defaults to 256kB.

    returns

    A future of a ReadFile[Id].

    Annotations
    @deprecated
    Deprecated

    (Since version 0.17.0) Will be moved to reactivemongo.play.iteratees.GridFS

  6. def saveWithMD5[Id <: P.Value](enumerator: Enumerator[Array[Byte]], file: FileToSave[pack.type, Id], chunkSize: Int = 262144)(implicit readFileReader: P.Reader[ReadFile[Id]], ec: ExecutionContext, idProducer: ((String, Id)) ⇒ Producer[BSONElement], docWriter: BSONDocumentWriter[P.Document]): Future[ReadFile[Id]]

    Saves the content provided by the given enumerator with the given metadata, with the MD5 computed.

    Saves the content provided by the given enumerator with the given metadata, with the MD5 computed.

    enumerator

    Producer of content.

    file

    Metadata of the file to store.

    chunkSize

    Size of the chunks. Defaults to 256kB.

    returns

    A future of a ReadFile[Id].

    Annotations
    @deprecated
    Deprecated

    (Since version 0.17.0) Will be moved to reactivemongo.play.iteratees.GridFS

  7. def x: GridFS[P]

    Implicit information
    This member is added by an implicit conversion from GridFS[P] to ArrowAssoc[GridFS[P]] performed by method any2ArrowAssoc in scala.Predef.
    Shadowing
    This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
    To access this member you can use a type ascription:
    (gridFS: ArrowAssoc[GridFS[P]]).x
    Definition Classes
    ArrowAssoc
    Annotations
    @deprecated
    Deprecated

    (Since version 2.10.0) Use leftOfArrow instead

  8. def x: GridFS[P]

    Implicit information
    This member is added by an implicit conversion from GridFS[P] to Ensuring[GridFS[P]] performed by method any2Ensuring in scala.Predef.
    Shadowing
    This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
    To access this member you can use a type ascription:
    (gridFS: Ensuring[GridFS[P]]).x
    Definition Classes
    Ensuring
    Annotations
    @deprecated
    Deprecated

    (Since version 2.10.0) Use resultOfEnsuring instead

Inherited from AnyRef

Inherited from Any

Inherited by implicit conversion any2stringadd from GridFS[P] to StringAdd

Inherited by implicit conversion any2stringfmt from GridFS[P] to StringFormat

Inherited by implicit conversion any2ArrowAssoc from GridFS[P] to ArrowAssoc[GridFS[P]]

Inherited by implicit conversion any2Ensuring from GridFS[P] to Ensuring[GridFS[P]]

Ungrouped