Packages

sealed trait GridFS[P <: SerializationPack with Singleton] extends GridFSSerialization[P]

A GridFS store.

Self Type
GridFS[P]
Linear Supertypes
GridFSSerialization[P], AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. GridFS
  2. GridFSSerialization
  3. AnyRef
  4. Any
Implicitly
  1. by any2stringadd
  2. by StringFormat
  3. by Ensuring
  4. by ArrowAssoc
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Type Members

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

Abstract Value Members

  1. abstract def db: DB with DBMetaCommands
    Attributes
    protected
  2. abstract def prefix: String
    Attributes
    protected

Concrete Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. def +(other: String): String
    Implicit
    This member is added by an implicit conversion from GridFS[P] toany2stringadd[GridFS[P]] performed by method any2stringadd in scala.Predef.
    Definition Classes
    any2stringadd
  4. def ->[B](y: B): (GridFS[P], B)
    Implicit
    This member is added by an implicit conversion from GridFS[P] toArrowAssoc[GridFS[P]] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @inline()
  5. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  6. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  7. def chunks(file: ReadFile[P.Value], readPreference: ReadPreference = defaultReadPreference)(implicit 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.

    file

    the file to be read

  8. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
  9. 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.

  10. def ensuring(cond: (GridFS[P]) => Boolean, msg: => Any): GridFS[P]
    Implicit
    This member is added by an implicit conversion from GridFS[P] toEnsuring[GridFS[P]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  11. def ensuring(cond: (GridFS[P]) => Boolean): GridFS[P]
    Implicit
    This member is added by an implicit conversion from GridFS[P] toEnsuring[GridFS[P]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  12. def ensuring(cond: Boolean, msg: => Any): GridFS[P]
    Implicit
    This member is added by an implicit conversion from GridFS[P] toEnsuring[GridFS[P]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  13. def ensuring(cond: Boolean): GridFS[P]
    Implicit
    This member is added by an implicit conversion from GridFS[P] toEnsuring[GridFS[P]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  14. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  15. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  16. def exists(implicit ec: ExecutionContext): Future[Boolean]

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

  17. def fileToSave[Id <: P.Value](_filename: Option[String], _contentType: Option[String], _uploadDate: Option[Long], _metadata: P.Document, _id: Id): FileToSave[pack.type, Id]

    Prepare the information to save a file.

  18. 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.

  19. def find(selector: P.Document)(implicit ec: ExecutionContext, r: FileReader[P.Value], cp: CursorProducer[ReadFile[P.Value]]): ProducedCursor

    Finds the files matching the given selector.

    Finds the files matching the given selector.

    selector

    the query to find the files

    r

    fileReader a file reader automatically resolved if Id is a valid value

    import scala.concurrent.ExecutionContext
    
    import reactivemongo.api.gridfs.GridFS
    
    import reactivemongo.api.bson.{ BSONDocument, BSONValue }
    import reactivemongo.api.bson.collection.{ BSONSerializationPack => Pack }
    
    def foo(gfs: GridFS[Pack.type], n: String)(implicit ec: ExecutionContext) =
      gfs.find(BSONDocument("filename" -> n)).headOption
  20. def find[S, Id <: P.Value](selector: S)(implicit w: P.Writer[S], r: FileReader[Id], cp: CursorProducer[ReadFile[Id]]): 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.

    Id

    the type of the file ID to be read

    import scala.concurrent.ExecutionContext
    
    import reactivemongo.api.gridfs.GridFS
    
    import reactivemongo.api.bson.{ BSONDocument, BSONValue }
    import reactivemongo.api.bson.collection.{ BSONSerializationPack => Pack }
    
    def foo(gfs: GridFS[Pack.type], n: String)(implicit ec: ExecutionContext) =
      gfs.find[BSONDocument, BSONValue](
        BSONDocument("filename" -> n)).headOption
    selector

    the query to find the files

    r

    fileReader a file reader automatically resolved if Id is a valid value

  21. def formatted(fmtstr: String): String
    Implicit
    This member is added by an implicit conversion from GridFS[P] toStringFormat[GridFS[P]] performed by method StringFormat in scala.Predef.
    Definition Classes
    StringFormat
    Annotations
    @inline()
  22. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  23. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  24. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  25. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  26. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  27. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  28. def readToOutputStream[Id <: P.Value](file: ReadFile[Id], out: OutputStream, readPreference: ReadPreference = defaultReadPreference)(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.

    file

    the file to be read

  29. def remove[Id <: P.Value](id: Id)(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

  30. def remove[Id <: P.Value](file: BasicMetadata[Id])(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.

    file

    the file entry to remove from this store

    Annotations
    @inline()
  31. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  32. def toString(): String
    Definition Classes
    GridFS → AnyRef → Any
  33. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  34. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  35. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  36. def writeFromInputStream[Id <: P.Value](file: FileToSave[pack.type, Id], input: InputStream, chunkSize: Int = 262144)(implicit ec: ExecutionContext): Future[ReadFile[Id]]

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

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated @deprecated
    Deprecated

    (Since version ) see corresponding Javadoc for more information.

  2. def [B](y: B): (GridFS[P], B)
    Implicit
    This member is added by an implicit conversion from GridFS[P] toArrowAssoc[GridFS[P]] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @deprecated
    Deprecated

    (Since version 2.13.0) Use -> instead. If you still wish to display it as one character, consider using a font with programming ligatures such as Fira Code.

Inherited from GridFSSerialization[P]

Inherited from AnyRef

Inherited from Any

Inherited by implicit conversion any2stringadd fromGridFS[P] to any2stringadd[GridFS[P]]

Inherited by implicit conversion StringFormat fromGridFS[P] to StringFormat[GridFS[P]]

Inherited by implicit conversion Ensuring fromGridFS[P] to Ensuring[GridFS[P]]

Inherited by implicit conversion ArrowAssoc fromGridFS[P] to ArrowAssoc[GridFS[P]]

Ungrouped