File tree Expand file tree Collapse file tree 4 files changed +37
-1
lines changed Expand file tree Collapse file tree 4 files changed +37
-1
lines changed Original file line number Diff line number Diff line change 33## Info
44
55GridFSDAO adds MongoDB [ GridFS] ( https://docs.mongodb.com/manual/core/gridfs/ ) support.
6+
67It provides easy upload, download and metadata handling.
78
89Sometimes also normal collections can be helpful for storing data.
Original file line number Diff line number Diff line change 22
33## Create
44
5- You need a fiename , an input stream and some kind of meatadata .
5+ You need a filename , an input stream and some kind of metadata .
66
77Possible Metadata types:
8+
89* Document
910* Map
1011* Scala Case Class
@@ -28,6 +29,7 @@ Do not use GridFS if you need to update the content of the entire file atomicall
2829GridFSFile will be deleted by a given ObjectID.
2930
3031With implicit conversion you can use for oid Parameter:
32+
3133* ObjectID
3234* GridFSFile
3335* String
Original file line number Diff line number Diff line change 1+ # GridFSDAO - Metadata
2+
3+ Metadata can be updated by the GridFSDAO.
4+
5+ ## Update complete Metadata
6+
7+ UpdateMetadata function will replace the whole metadata for one file.
8+
9+ ``` scala
10+
11+ val value = Map (" index" -> 11 , " category" -> " templates" )
12+ ImageFilesDAO .updateMetadata(oid, value)
13+
14+ ```
15+
16+ ## Update Metadata elements
17+
18+ UpdateMetadataElement/s update some part of the metadata by a given filter.
19+
20+
21+ ``` scala
22+
23+ val elements = Map (" category" -> " logos" )
24+ val filter = Map () // all files
25+ ImageFilesDAO .updateMetadataElements(filter, elements)
26+
27+
28+ ```
29+
30+
31+
32+
Original file line number Diff line number Diff line change @@ -48,6 +48,7 @@ libraryDependencies += "com.sfxcode.nosql" %% "simple-mongo" % $app-version$
4848 - [ MongoDAO Search] ( dao/search.md )
4949 - [ GridFSDAO] ( dao/gridfs_dao.md )
5050 - [ GridFSDAO CRUD] ( gridfs/crud.md )
51+ - [ GridFSDAO Metadata] ( gridfs/metadata.md )
5152 - [ Feature Aggregation] ( features/aggregation.md )
5253 - [ Feature Relationships] ( features/relationships.md )
5354 - [ Feature Observable] ( features/observable.md )
You can’t perform that action at this time.
0 commit comments