sealed trait GridFS[P <: SerializationPack] extends PackSupport[P] with InsertCommand[P] with DeleteCommand[P] with UpdateCommand[P] with UpdateWriteResultFactory[P] with UpsertedFactory[P] with CommandCodecsWithPack[P] with QueryBuilderFactory[P]
- Alphabetic
- By Inheritance
- GridFS
- QueryBuilderFactory
- HintFactory
- CommandCodecsWithPack
- UpsertedFactory
- UpdateWriteResultFactory
- UpdateCommand
- DeleteCommand
- InsertCommand
- PackSupport
- AnyRef
- Any
- by any2stringadd
- by StringFormat
- by Ensuring
- by ArrowAssoc
- Hide All
- Show All
- Public
- Protected
Type Members
- final class QueryBuilder extends AnyRef
A builder that helps to make a fine-tuned query to MongoDB.
A builder that helps to make a fine-tuned query to MongoDB.
When the query is ready, you can call
cursor
to get a Cursor, orone
if you want to retrieve just one document.- Definition Classes
- QueryBuilderFactory
- final class Upserted extends AnyRef
An upserted element
An upserted element
- Definition Classes
- UpsertedFactory
- final type DeleteCmd = ResolvedCollectionCommand[Delete]
- Attributes
- protected
- Definition Classes
- DeleteCommand
- final class DeleteElement extends AnyRef
Delete command element
Delete command element
- Definition Classes
- DeleteCommand
- final type DeleteResult = DefaultWriteResult
Result for a delete command
Result for a delete command
- Definition Classes
- DeleteCommand
- type FileToSave[Id <: P.Value] = gridfs.FileToSave[Id, P.Document]
- sealed trait Hint extends AnyRef
An index hint
An index hint
- Definition Classes
- HintFactory
- type ReadFile[+Id <: P.Value] = gridfs.ReadFile[Id, P.Document]
- final type UpdateCmd = ResolvedCollectionCommand[Update]
- Attributes
- protected[reactivemongo]
- Definition Classes
- UpdateCommand
- final class UpdateElement extends AnyRef
- Definition Classes
- UpdateCommand
- final class UpdateWriteResult extends WriteResult
Result for the update operations.
Result for the update operations.
- Definition Classes
- UpdateWriteResultFactory
Abstract Value Members
- abstract def db: DB with DBMetaCommands
- Attributes
- protected
- abstract val pack: P
The serialization pack (BSON by default).
The serialization pack (BSON by default).
Used to resolve the types of values (by default
BSONValue
,BSONDocument
, ...), and the related typeclasses (e.g.BSONDocumentReader
...).- Definition Classes
- PackSupport
- abstract def prefix: String
- Attributes
- protected
Concrete Value Members
- object Upserted
- Definition Classes
- UpsertedFactory
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- def +(other: String): String
- def ->[B](y: B): (GridFS[P], B)
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- 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
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- final def deleteWriter(session: Option[Session]): P.Writer[DeleteCmd]
- Attributes
- protected
- Definition Classes
- DeleteCommand
- implicit final lazy val deleteWriter: P.Writer[DeleteCmd]
- Attributes
- protected
- Definition Classes
- DeleteCommand
- def ensureIndex()(implicit ec: ExecutionContext): Future[Boolean]
Creates the needed indexes on the GridFS collections (
chunks
andfiles
).Creates the needed indexes on the GridFS collections (
chunks
andfiles
).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.
- Annotations
- @SuppressWarnings()
- def ensuring(cond: (GridFS[P]) => Boolean, msg: => Any): GridFS[P]
- def ensuring(cond: (GridFS[P]) => Boolean): GridFS[P]
- def ensuring(cond: Boolean, msg: => Any): GridFS[P]
- def ensuring(cond: Boolean): GridFS[P]
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def exists(implicit ec: ExecutionContext): Future[Boolean]
Returns whether the data related to this GridFS instance exists on the database.
Returns whether the data related to this GridFS instance exists on the database.
- Annotations
- @SuppressWarnings()
- def fileToSave[Id <: P.Value](filename: Option[String], contentType: Option[String], uploadDate: Option[Long], metadata: P.Document, id: Id): FileToSave[Id]
Prepare the information to save a file.
- def fileToSave(filename: Option[String] = None, contentType: Option[String] = None, uploadDate: Option[Long] = None, metadata: P.Document = document(Seq.empty)): FileToSave[P.Value]
Prepare the information to save a file.
Prepare the information to save a file. The unique ID is automatically generated.
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- def find(selector: P.Document)(implicit 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
- 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
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hint(specification: P.Document): Hint
Returns a hint for the given index
specification
document.Returns a hint for the given index
specification
document.- specification
the index specification document
- Definition Classes
- HintFactory
- def hint(name: String): Hint
Returns a hint for the given index
name
.Returns a hint for the given index
name
.- name
the index name
- Definition Classes
- HintFactory
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- lazy val maxWireVersion: MongoWireVersion
- Attributes
- protected
- Definition Classes
- GridFS → UpdateCommand
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- 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
- 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
- implicit final lazy val resultReader: P.Reader[DefaultWriteResult]
- Attributes
- protected
- Definition Classes
- CommandCodecsWithPack
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- GridFS → AnyRef → Any
- def update[Id <: P.Value](id: Id, metadata: P.Document)(implicit ec: ExecutionContext): Future[WriteResult]
Updates the metadata document for the specified file.
Updates the metadata document for the specified file.
- id
the id of the file to be updated
- metadata
the file new metadata
- implicit final def updateReader: P.Reader[UpdateWriteResult]
- Attributes
- protected
- Definition Classes
- UpdateCommand
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def writeElement(builder: Builder[pack.type]): (UpdateElement) => P.Document
- Attributes
- protected[reactivemongo]
- Definition Classes
- UpdateCommand
- def writeFromInputStream[Id <: P.Value](file: FileToSave[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
- 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
- @deprecated @inline()
- Deprecated
(Since version 2.12.16) Use
formatString.format(value)
instead ofvalue.formatted(formatString)
, or use thef""
string interpolator. In Java 15 and later,formatted
resolves to the new method in String which has reversed parameters.
- 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.