To list files named with given name use named
syntax:
list named ("file1")
Concrete files can be queried by specifying their id
:
list withId (fileId)
Each mongodb file stores metadata that can content basically everything as normal bson document. However there
are some specific properties that are included in this document:
chunk
. File is chunked in database and then reassembled on readMetadata are thus residing in metadata
key, and anything that has to be queried in metadata must be prefixed by metadata
.
Following are the examples of complex file queries :
a
:list files ("filename" regex ".*a.*")
text/plain; charset=UTF-8
:list files ("contentType" === "text/plain; charset=UTF-8")
user
is luke
:list files ("metadata.user" === "luke")
The individual listing of the files can be combined together to make different queries, even from different filesystems
via append
(or ++
) combinator.
val allFiles = (list named ("alpha")) ++
(list named ("beta")) ++
(list files ("filename" regex "g.*"))
Total for specification FSListSpec | |
---|---|
Finished in | 5 seconds, 813 ms |
Results | 7 examples, 0 failure, 0 error, 1 pending |