A GridFS store.
Attributes
Members list
Type members
Inherited classlikes
Delete command element
Delete command element
Attributes
- Inherited from:
- DeleteCommand (hidden)
- Graph
- Supertypes
- class Objecttrait Matchableclass Any
An index hint
An index hint
Attributes
- Inherited from:
- HintFactory (hidden)
- Graph
- Supertypes
- class Objecttrait Matchableclass Any
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, or one
if you want to retrieve just one document.
Attributes
- batchSize
the upper limit on the number of documents to retrieve per batch (0 for unspecified)
- collation
the optional collation to use for the find command (default:
None
) {@since MongoDB 3.4}import scala.concurrent.{ ExecutionContext, Future } import reactivemongo.api.bson.BSONDocument import reactivemongo.api.bson.collection.BSONCollection def firstFirst(coll: BSONCollection)( implicit ec: ExecutionContext): Future[Option[BSONDocument]] = { val queryBuilder = coll.find(BSONDocument.empty) queryBuilder.one[BSONDocument] }
- comment
the query comment
- cursorOptions
the cursor options
- explain
the explain flag
- filter
the query filter
- hint
the index to “hint” or force MongoDB to use when performing the query.
- max
the optional exclusive upper bound for a specific index (default:
None
)- maxScan
this option specifies a maximum number of documents or index keys the query plan will scan.
- maxTimeMs
the maximum execution time
- min
the optional exclusive lower bound for a specific index (default:
None
)- projection
- readConcern
the read concern {@since MongoDB 3.6}
- readPreference
the query ReadPreference
- returnKey
if this flag is true, returns only the index keys in the resulting documents
- showRecordId
the flags to determines whether to return the record identifier for each document
- singleBatch
the flag to determines whether to close the cursor after the first batch (default:
false
)- skip
the number of documents to skip.
- snapshot
the snapshot flag
- sort
the optional sort specification
- Inherited from:
- QueryBuilderFactory
- Graph
- Supertypes
- class Objecttrait Matchableclass Any
Attributes
- arrayFilters
an array of filter documents that determines which array elements to modify for an update operation on an array field
- collation
the collation to use for the operation
- multi
if true updates all the matching documents
- q
the query that matches the documents to update
- u
the modifications to apply
- upsert
if true perform an insert if no documents match the query
- Inherited from:
- UpdateCommand (hidden)
- Graph
- Supertypes
- class Objecttrait Matchableclass Any
Result for the update operations.
Result for the update operations.
Attributes
- n
the number of documents selected for update
- nModified
the number of updated documents
- ok
the update status
- upserted
the upserted documents
- Inherited from:
- UpdateWriteResultFactory (hidden)
- Graph
- Supertypes
An upserted element
An upserted element
Attributes
- Inherited from:
- UpsertedFactory
- Graph
- Supertypes
- class Objecttrait Matchableclass Any
Attributes
- Inherited from:
- UpsertedFactory
- Graph
- Supertypes
- class Objecttrait Matchableclass Any
Types
Inherited types
Result for a delete command
Result for a delete command
Attributes
- Inherited from:
- DeleteCommand (hidden)
Value members
Concrete methods
Returns a cursor for the chunks of the specified file. The cursor walks the chunks orderly.
Returns a cursor for the chunks of the specified file. The cursor walks the chunks orderly.
Attributes
- file
the file to be read
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.
Attributes
- Returns:
A future containing true if the index was created, false if it already exists.
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.
Attributes
Prepare the information to save a file. The unique ID is automatically generated.
Prepare the information to save a file. The unique ID is automatically generated.
Attributes
Prepare the information to save a file.
Prepare the information to save a file.
Attributes
Finds the files matching the given selector.
Finds the files matching the given selector.
Attributes
- 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
- S
The type of the selector document. An implicit
Writer[S]
must be in the scope.- r
fileReader a file reader automatically resolved if
Id
is a valid value- selector
the query to find the files
Finds the files matching the given selector.
Finds the files matching the given selector.
Attributes
- r
fileReader a file reader automatically resolved if
Id
is a valid valueimport scala.concurrent.ExecutionContext import reactivemongo.api.gridfs.GridFS import reactivemongo.api.bson.BSONDocument import reactivemongo.api.bson.collection.{ BSONSerializationPack => Pack } def foo(gfs: GridFS[Pack.type], n: String)(implicit ec: ExecutionContext) = gfs.find(BSONDocument("filename" -> n)).headOption
- selector
the query to find the files
Reads the given file and writes its contents to the given OutputStream.
Reads the given file and writes its contents to the given OutputStream.
Attributes
- file
the file to be read
Removes a file from this store. Note that if the file does not actually exist, the returned future will not be hold an error.
Removes a file from this store. Note that if the file does not actually exist, the returned future will not be hold an error.
Attributes
- id
the file id to remove from this store
Returns a string representation of the object.
Returns a string representation of the object.
The default representation is platform dependent.
Attributes
- Returns:
a string representation of the object.
- Definition Classes
- Any
Updates the metadata document for the specified file.
Updates the metadata document for the specified file.
Attributes
- id
the id of the file to be updated
- metadata
the file new metadata
Writes the data provided by the given InputStream to the given file.
Writes the data provided by the given InputStream to the given file.
Attributes
Inherited methods
Attributes
- Inherited from:
- GridFSCompat (hidden)
Attributes
- Inherited from:
- DeleteCommand (hidden)
Returns a hint for the given index specification
document.
Returns a hint for the given index specification
document.
Attributes
- specification
the index specification document
- Inherited from:
- HintFactory (hidden)
Implicits
Inherited implicits
Attributes
- Inherited from:
- CommandCodecsWithPack (hidden)
Attributes
- Inherited from:
- UpdateCommand (hidden)