Skip to content

Commit 12dc68c

Browse files
committed
Metadata Docs added
1 parent 54d26db commit 12dc68c

File tree

4 files changed

+37
-1
lines changed

4 files changed

+37
-1
lines changed

src/main/paradox/dao/gridfs_dao.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
## Info
44

55
GridFSDAO adds MongoDB [GridFS](https://docs.mongodb.com/manual/core/gridfs/) support.
6+
67
It provides easy upload, download and metadata handling.
78

89
Sometimes also normal collections can be helpful for storing data.

src/main/paradox/gridfs/crud.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
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

77
Possible 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
2829
GridFSFile will be deleted by a given ObjectID.
2930

3031
With implicit conversion you can use for oid Parameter:
32+
3133
* ObjectID
3234
* GridFSFile
3335
* String
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
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+

src/main/paradox/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff 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)

0 commit comments

Comments
 (0)