Skip to content

Commit 73211f5

Browse files
committed
docs updated
1 parent 2cd6e79 commit 73211f5

File tree

7 files changed

+80
-13
lines changed

7 files changed

+80
-13
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ Add following lines to your build.sbt
3838
```
3939
resolvers += "sxfcode Bintray Repo" at "https://dl.bintray.com/sfxcode/maven/"
4040
41-
libraryDependencies += "com.sfxcode.nosql" %% "simple-mongo" % "1.3.0"
41+
libraryDependencies += "com.sfxcode.nosql" %% "simple-mongo" % "1.5.0"
4242
4343
```
4444

src/main/paradox/dao/crud.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## Info
44

5-
CRUD Collection functions. All functions support synchronous result handling (add Result to function name, e.g. drop -> dropResult).
5+
CRUD Collection functions.
66

77
## Create
88

src/main/paradox/dao/gridfs_dao.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,14 @@
55
GridFSDAO adds MongoDB [GridFS](https://docs.mongodb.com/manual/core/gridfs/) support.
66
It provides easy upload, download and metadata handling.
77

8+
Sometimes also normal collections can be helpful for storing data.
9+
10+
@@@ note { title=Official_MongoDB_Documentation }
11+
12+
Furthermore, if your files are all smaller than the 16 MB BSON Document Size limit, consider storing each file in a single document instead of using GridFS. You may use the BinData data type to store the binary data. See your drivers documentation for details on using BinData.Furthermore, if your files are all smaller than the 16 MB BSON Document Size limit, consider storing each file in a single document instead of using GridFS. You may use the BinData data type to store the binary data. See your drivers documentation for details on using BinData.
13+
14+
@@@
15+
816
## Usage
917

1018
A [MongoDatabase](http://mongodb.github.io/mongo-scala-driver/2.3/scaladoc/org/mongodb/scala/MongoDatabase.html) and a bucket name is needed.
@@ -13,6 +21,14 @@ A [MongoDatabase](http://mongodb.github.io/mongo-scala-driver/2.3/scaladoc/org/m
1321

1422
```scala
1523

24+
/**
25+
* use bucket name fs
26+
*/
27+
object ImageFilesDAO extends GridFSDAO(database)
28+
29+
/**
30+
* use bucket name images
31+
*/
1632
object ImageFilesDAO extends GridFSDAO(database, "images")
1733

1834
```

src/main/paradox/dao/mongo_dao.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ MongoDAO is the core of this framework. The [DAO](https://en.wikipedia.org/wiki
66

77
The MongoDAO object holds a reference to a [MongoCollection](http://mongodb.github.io/mongo-scala-driver/2.3/scaladoc/org/mongodb/scala/MongoCollection.html) and adds functions for easy collection handling.
88

9-
All functions support synchronous result handling (add Result to function name, e.g. drop -> dropResult, insert ->insertResult).
109

1110
## Features
1211

src/main/paradox/features/observable.md

Whitespace-only changes.

src/main/paradox/gridfs/crud.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# GridFSDAO - CRUD Functions
2+
3+
## Create
4+
5+
You need a fiename, an input stream and some kind of meatadata.
6+
7+
Possible Metadata types:
8+
* Document
9+
* Map
10+
* Scala Case Class
11+
12+
Return Observable of ObjectId.
13+
14+
```scala
15+
ImageFilesDAO.insertOne(filename, stream, metadata)
16+
```
17+
18+
## Update
19+
20+
@@@ note { title=Official_MongoDB_Documentation }
21+
22+
Do not use GridFS if you need to update the content of the entire file atomically. As an alternative you can store multiple versions of each file and specify the current version of the file in the metadata. You can update the metadata field that indicates “latest” status in an atomic update after uploading the new version of the file, and later remove previous versions if needed.Do not use GridFS if you need to update the content of the entire file atomically. As an alternative you can store multiple versions of each file and specify the current version of the file in the metadata. You can update the metadata field that indicates “latest” status in an atomic update after uploading the new version of the file, and later remove previous versions if needed.
23+
24+
@@@
25+
26+
## Delete
27+
28+
GridFSFile will be deleted by a given ObjectID.
29+
30+
With implicit conversion you can use for oid Parameter:
31+
* ObjectID
32+
* GridFSFile
33+
* String
34+
35+
```scala
36+
// for implicit conversion usage
37+
import com.sfxcode.nosql.mongo._
38+
39+
ImageFilesDAO.deleteOne(oid)
40+
```

src/main/paradox/index.md

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,33 @@
22

33
A library for easy usage of the mongo-scala-driver.
44

5-
Implement the [DAO](https://en.wikipedia.org/wiki/Data_access_object) Pattern for easy database usage.
5+
Features:
66

7-
Enhanced [BSON](http://mongodb.github.io/mongo-scala-driver/2.2/bson/) conversion support.
7+
* Implement the [DAO](https://en.wikipedia.org/wiki/Data_access_object) Pattern for easy MongoDB database usage.
88

9-
[GridFS](https://docs.mongodb.com/manual/core/gridfs/) support.
9+
* Enhanced [BSON](http://mongodb.github.io/mongo-scala-driver/2.2/bson/) conversion support.
1010

11-
## Additional Documentation
11+
* [GridFS](https://docs.mongodb.com/manual/core/gridfs/) support.
1212

13+
## Additional Documentation
1314

14-
Documentation for [mongo-scala-driver](http://mongodb.github.io/mongo-scala-driver/2.2/)
1515

16-
Documentation for [MongoDB](https://docs.mongodb.com/)
16+
* [mongo-scala-driver](http://mongodb.github.io/mongo-scala-driver/2.2/)
17+
* [MongoDB](https://docs.mongodb.com/)
1718

1819

1920
## Dependency Setup
2021

22+
Support Scala 2.11 and Scala 2.12.
23+
24+
```
25+
resolvers += "sxfcode Bintray Repo" at "https://dl.bintray.com/sfxcode/maven/"
26+
27+
libraryDependencies += "com.sfxcode.nosql" %% "simple-mongo" % $app-version$
28+
29+
```
30+
### 2.12 Dependency
31+
2132
@@dependency[sbt,Maven,Gradle] {
2233
group="com.sfxcode.nosql"
2334
artifact="simple-mongo_2.12"
@@ -30,17 +41,18 @@ Documentation for [MongoDB](https://docs.mongodb.com/)
3041

3142
@@@ index
3243

33-
- [Tutorial Setup](tutorial/setup.md)
34-
- [Tutorial Database](tutorial/database.md)
35-
- [Tutorial Functions](tutorial/functions.md)
36-
- [Tutorial Application](tutorial/application.md)
3744
- [MongoDAO](dao/mongo_dao.md)
3845
- [MongoDAO Base](dao/base.md)
3946
- [MongoDAO CRUD](dao/crud.md)
4047
- [MongoDAO Search](dao/search.md)
4148
- [GridFSDAO](dao/gridfs_dao.md)
49+
- [GridFSDAO CRUD](gridfs/crud.md)
4250
- [Feature Aggregation](features/aggregation.md)
4351
- [Feature Relationships](features/relationships.md)
52+
- [Tutorial Setup](tutorial/setup.md)
53+
- [Tutorial Database](tutorial/database.md)
54+
- [Tutorial Functions](tutorial/functions.md)
55+
- [Tutorial Application](tutorial/application.md)
4456
- [Changes ](changes.md)
4557

4658
@@@

0 commit comments

Comments
 (0)