Skip to content

Commit

Permalink
refactor(Project): moved to github mongocamp organization
Browse files Browse the repository at this point in the history
from sfxcode simple-mongo to mongocamp
  • Loading branch information
sfxcode committed Mar 25, 2022
1 parent 028aa44 commit bb65f8b
Show file tree
Hide file tree
Showing 91 changed files with 304 additions and 313 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ branches:
notifications:
email:
recipients:
- tom@sfxcode.com
- tom@mongocamp.com
jdk:
- openjdk11
- openjdk8
Expand All @@ -24,7 +24,7 @@ before_script:
- echo "replSet = myReplSetName" | sudo tee -a /etc/mongodb.conf
- sudo systemctl unmask mongod && sudo service mongod start
- sleep 20
- mongo --eval 'rs.initiate()'
- mongodb --eval 'rs.initiate()'
- sleep 15

after_success:
Expand Down
25 changes: 11 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# simple-mongo
# Mongocamp MongoDB Driver

A library for easy usage of the mongo-scala-driver (4.5.x). Full MongoDB Functionality in Scala with a few lines of code.

## MongoDB Support

Support MongoDB 2.6 to 4.2.
Support MongoDB 2.6 to 5.0.x.

## Features

Expand All @@ -23,22 +23,20 @@ Support MongoDB 2.6 to 4.2.

## Documentation

Documentation can be found [here](https://sfxcode.github.io/simple-mongo/).
Documentation can be found [here](https://sfxcode.github.io/mongocamp/).

## Version

Scala Version is 2.13.x / 2.12.x.

## CI

[![Scala CI](https://github.com/sfxcode/simple-mongo/actions/workflows/scala.yml/badge.svg)](https://github.com/sfxcode/simple-mongo/actions/workflows/scala.yml)
## Download

[ ![Download](https://api.bintray.com/packages/sfxcode/maven/simple-mongo/images/download.svg) ](https://bintray.com/sfxcode/maven/simple-mongo/_latestVersion)
## Download

## Licence

[Apache 2 License](https://github.com/sfxcode/simple-mongo/blob/master/LICENSE).
[Apache 2 License](https://github.com/sfxcode/mongocamp/blob/master/LICENSE).


## Usage
Expand All @@ -47,19 +45,18 @@ Add following lines to your build.sbt (replace x.x with the actual Version)

```
libraryDependencies += "com.sfxcode.nosql" %% "simple-mongo" % "2.x.x"
libraryDependencies += "dev.mongocamp.driver" %% "mongocamp" % "2.x.x"
```

Define MongoDB Connection and [DAO](https://en.wikipedia.org/wiki/Data_access_object) objects for automatic case class conversion.


```scala

import java.util.Date

import com.sfxcode.nosql.mongo.MongoDAO
import com.sfxcode.nosql.mongo.database.DatabaseProvider
import dev.mongocamp.driver.mongodb.MongoDAO
import dev.mongocamp.driver.mongodb.database.DatabaseProvider
import org.bson.codecs.configuration.CodecRegistries._
import org.mongodb.scala.bson.ObjectId
import org.mongodb.scala.bson.codecs.Macros._
Expand Down Expand Up @@ -91,8 +88,8 @@ Import the database object and execute some find and CRUD functions on the DAO o

```scala

import com.sfxcode.nosql.mongo.demo.restaurant.RestaurantDemoDatabase._
import com.sfxcode.nosql.mongo._
import dev.mongocamp.driver.mongodb.demo.restaurant.RestaurantDemoDatabase._
import dev.mongocamp.driver.mongodb._

trait RestaurantDemoDatabaseFunctions {

Expand Down Expand Up @@ -140,7 +137,7 @@ Write some spec tests ...

```scala

import com.sfxcode.nosql.mongo.demo.restaurant.RestaurantDemoDatabase._
import dev.mongocamp.driver.mongodb.demo.restaurant.RestaurantDemoDatabase._
import org.specs2.mutable.Specification

class RestaurantDemoSpec extends Specification with RestaurantDemoDatabaseFunctions {
Expand Down
17 changes: 8 additions & 9 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name := "simple-mongo"
name := "mongocamp-driver-mongodb"

crossScalaVersions := Seq("2.13.8", "2.12.15")

Expand All @@ -8,33 +8,32 @@ scalacOptions += "-deprecation"

Test / parallelExecution := false

lazy val simple_mongo = (project in file("."))
lazy val mongodb = (project in file("."))
.enablePlugins(BuildInfoPlugin)
.settings(
buildInfoKeys ++= Seq[BuildInfoKey](name, version, scalaVersion, sbtVersion),
buildInfoPackage := "com.sfxcode.nosql.mongo"
buildInfoPackage := "dev.mongocamp.driver.mongodb"
)

lazy val docs = (project in file("docs"))
.enablePlugins(ParadoxSitePlugin)
.enablePlugins(ParadoxMaterialThemePlugin)
.enablePlugins(GhpagesPlugin)
.settings(
name := "simple mongo docs",
name := "simple mongodb docs",
scalaVersion := "2.13.7",
resolvers += "SFXCode" at "https://dl.bintray.com/sfxcode/maven/",
libraryDependencies += "com.sfxcode.nosql" % "simple-mongo_2.13" % "2.3.0",
libraryDependencies += "org.xerial.snappy" % "snappy-java" % "1.1.8.4",
publish / skip := true,
ghpagesNoJekyll := true,
git.remoteRepo := "git@github.com:sfxcode/simple-mongo.git",
git.remoteRepo := "git@github.com:mongocamp/mongocampdb.git",
Compile / paradoxMaterialTheme ~= {
_.withRepository(uri("https://github.com/sfxcode/simple-mongo"))
_.withRepository(uri("https://github.com/sfxcode/mongocamp"))
},
(Compile / paradoxMarkdownToHtml / excludeFilter) := (Compile / paradoxMarkdownToHtml / excludeFilter).value ||
ParadoxPlugin.InDirectoryFilter((Compile / paradox / sourceDirectory).value / "includes")
)
.dependsOn(simple_mongo)
.dependsOn(mongodb)

buildInfoOptions += BuildInfoOption.BuildTime

Expand Down Expand Up @@ -76,7 +75,7 @@ libraryDependencies += "com.typesafe.scala-logging" %% "scala-logging" % "3.9.4"

libraryDependencies += "org.scala-lang.modules" %% "scala-collection-compat" % "2.7.0"

buildInfoPackage := "com.sfxcode.nosql.mongo"
buildInfoPackage := "dev.mongocamp.driver.mongodb"

buildInfoOptions += BuildInfoOption.BuildTime

Expand Down
4 changes: 2 additions & 2 deletions docs/src/main/paradox/changes.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Version History
## Current Version
[ ![Download](https://api.bintray.com/packages/sfxcode/maven/simple-mongo/images/download.svg) ](https://bintray.com/sfxcode/maven/simple-mongo/_latestVersion)
[ ![Download](https://api.bintray.com/packages/sfxcode/maven/mongocamp/images/download.svg) ](https://bintray.com/sfxcode/maven/mongocamp/_latestVersion)


## History

@@snip [Changes.md](/CHANGES.md)
@@snip [Changes.md](/CHANGES.md)
5 changes: 3 additions & 2 deletions docs/src/main/paradox/dao/base.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@ are implemented.
All functions support synchronous result handling.

Use pacckage import

```scala
import com.sfxcode.nosql.mongo._
import dev.mongocamp.driver.mongodb._
```

and append
Expand Down Expand Up @@ -76,4 +77,4 @@ def dropIndex(keys: Bson): SingleObservable[Void]
// Simple Index delete
def dropIndexForName(name: String): SingleObservable[Void]

```
```
2 changes: 1 addition & 1 deletion docs/src/main/paradox/dao/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ A Type Parameter is used for automatic Document to Class conversion (case classe
### Use DAO

```scala
import com.sfxcode.nosql.mongo._
import dev.mongocamp.driver.mongodb._

def restaurantsSize: Long = RestaurantDAO.count()

Expand Down
6 changes: 3 additions & 3 deletions docs/src/main/paradox/dao/search.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@

```scala
// Filter helper functions
import com.sfxcode.nosql.mongo.Filter._
import dev.mongocamp.driver.mongodb.Filter._
// sort helper functions
import com.sfxcode.nosql.mongo.Sort._
import dev.mongocamp.driver.mongodb.Sort._
// implicits like Document from Map ...
import com.sfxcode.nosql.mongo._
import dev.mongocamp.driver.mongodb._
```

### Execute Search
Expand Down
2 changes: 1 addition & 1 deletion docs/src/main/paradox/database/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ It is used for DatabaseProvider creation.
| database | default database to use | |
| host | | 127.0.0.1 |
| port | | 27017 |
| applicationName | | simple-mongo-app |
| applicationName | | mongocamp-app |
| userName | used for Authentification | |
| password | used for Authentification | |
| poolOptions | | MongoPoolOptions() |
Expand Down
6 changes: 3 additions & 3 deletions docs/src/main/paradox/database/reactive_streams.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Reactive Streams

* The MongoDB Scala driver is built upon [Reactive Streams](https://www.reactive-streams.org/)
* simple-mongo wraps around the scala driver => Full support of Reactive Streams
* mongocamp wraps around the scala driver => Full support of Reactive Streams
* For Blocking Results (implicit) conversion to Result Objects is provided
* Conversion of Observable to Future is available

Expand Down Expand Up @@ -35,10 +35,10 @@ All functions have an optional maxWait parameter (Default maxWait = 10 seconds).

### Implicit Result Conversion (Blocking)

To use implicit result conversion, you have to import the simple mongo base package object.
To use implicit result conversion, you have to import the mongocamp mongodb base package object.

```scala
import com.sfxcode.nosql.mongo._
import dev.mongocamp.driver.mongodb._
```

After that, implicit conversion and other useful implicits (e.g. Map -> Bson) are available.
Expand Down
4 changes: 2 additions & 2 deletions docs/src/main/paradox/gridfs/crud.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ With implicit conversion you can use for OID Parameter:

```scala
// for implicit conversion usage
import com.sfxcode.nosql.mongo._
import dev.mongocamp.driver.mongodb._

ImageFilesDAO.deleteOne(oid)
```
```
14 changes: 7 additions & 7 deletions docs/src/main/paradox/index.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# simple-mongo
# mongocamp

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

Expand All @@ -7,7 +7,7 @@ Features:
* Easy Database Config with @ref:[provider](database/provider.md) and MongoConfig
* Implement the [DAO](https://en.wikipedia.org/wiki/Data_access_object) Pattern for simple MongoDB usage (@ref:[MongoDAO](dao/index.md))
* [GridFS](https://mongodb.github.io/mongo-java-driver/4.0/driver-scala/tutorials/gridfs/) support (@ref:[GridFSDAO](gridfs/index.md))
* [Reactive Streams](https://mongodb.github.io/mongo-java-driver/4.0/driver-scala/getting-started/quick-start-primer/) support (@ref:[Usage in simple-mongo](database/reactive_streams.md))
* [Reactive Streams](https://mongodb.github.io/mongo-java-driver/4.0/driver-scala/getting-started/quick-start-primer/) support (@ref:[Usage in mongocamp](database/reactive_streams.md))
* Enhanced [BSON](https://mongodb.github.io/mongo-java-driver/4.0/driver-scala/bson/) conversion support (@ref:[Bson](database/bson.md))
* @ref:[Relationships](database/relationships.md)

Expand All @@ -21,24 +21,24 @@ Features:
Support Scala 2.12 and Scala 2.13.

@@dependency[sbt,Maven,Gradle] {
group="com.sfxcode.nosql"
artifact="simple-mongo_2.13"
group="dev.mongocamp.driver"
artifact="mongocamp_2.13"
version="$project.version$"
}

## Licence

[Apache 2](https://github.com/sfxcode/simple-mongo/blob/master/LICENSE)
[Apache 2](https://github.com/sfxcode/mongocamp/blob/master/LICENSE)

## Example: Model

Create custom model classes.

@@snip [model.scala](../../../../src/test/scala/com/sfxcode/nosql/mongo/model/model.scala) { #model_student }
@@snip [model.scala](../../../../src/test/scala/com/mongocamp/driver/mongodb/model/model.scala) { #model_student }

## Example: Database

@@snip [UniversityDatabase.scala](../../../../src/test/scala/com/sfxcode/nosql/mongo/test/UniversityDatabase.scala)
@@snip [UniversityDatabase.scala](../../../../src/test/scala/com/mongocamp/driver/mongodb/test/UniversityDatabase.scala)

@@@ index

Expand Down
2 changes: 1 addition & 1 deletion docs/src/main/paradox/server.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# LocalServer

simple-mongo supports LocalServer by [mongo-java-server](https://github.com/bwaldvogel/mongo-java-server) (since 2.0.1).
mongocamp supports LocalServer by [mongo-java-server](https://github.com/bwaldvogel/mongo-java-server) (since 2.0.1).

Useful for tests and small offline Apps. Dependency to mongo-java-server is marked as provided, you have to import the dependency by yourself.

Expand Down
4 changes: 2 additions & 2 deletions docs/src/main/scala/DatabaseProviderDoc.scala
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import com.sfxcode.nosql.mongo.database.{CollectionInfo, DatabaseProvider, MongoConfig}
import dev.mongocamp.driver.mongodb.database.{CollectionInfo, DatabaseProvider, MongoConfig}
import org.bson.codecs.configuration.CodecRegistries.fromProviders
import org.bson.codecs.configuration.CodecRegistry
import org.mongodb.scala.bson.ObjectId
Expand All @@ -20,7 +20,7 @@ object DatabaseProviderDoc {
// #sample_config_from_path

// #sample_config_from_custom_path
val customConfig: MongoConfig = MongoConfig.fromPath("mongo.db.prod")
val customConfig: MongoConfig = MongoConfig.fromPath("mongodb.db.prod")
// #sample_config_from_custom_path

// #provider
Expand Down
4 changes: 2 additions & 2 deletions docs/src/main/scala/GridfsDatabaseApp.scala
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//import com.sfxcode.nosql.mongo.gridfs.GridfsDatabaseFunctions
//import com.sfxcode.nosql.mongo.model.ImageMetadata
//import dev.mongocamp.driver.mongodb.gridfs.GridfsDatabaseFunctions
//import dev.mongocamp.driver.mongodb.model.ImageMetadata
//import org.bson.types.ObjectId
//
//object GridfsDatabaseApp extends App with GridfsDatabaseFunctions {
Expand Down
8 changes: 4 additions & 4 deletions docs/src/main/scala/ReactiveStreamsDoc.scala
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import java.util.concurrent.TimeUnit

import com.sfxcode.nosql.MongoImplicits
import com.sfxcode.nosql.mongo._
import com.sfxcode.nosql.mongo.model.Person
import com.sfxcode.nosql.mongo.test.TestDatabase.{ImageFilesDAO, PersonDAO}
import dev.mongocamp.driver.MongoImplicits
import dev.mongocamp.driver.mongodb._
import dev.mongocamp.driver.mongodb.model.Person
import dev.mongocamp.driver.mongodb.test.TestDatabase.{ImageFilesDAO, PersonDAO}

import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.duration.Duration
Expand Down
6 changes: 3 additions & 3 deletions docs/src/main/scala/UniversityApp.scala
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import com.sfxcode.nosql.mongo.test.UniversityDatabase._
import com.sfxcode.nosql.mongo._
import com.sfxcode.nosql.mongo.server.LocalServer
import dev.mongocamp.driver.mongodb.test.UniversityDatabase._
import dev.mongocamp.driver.mongodb._
import dev.mongocamp.driver.mongodb.server.LocalServer

object UniversityApp extends App {

Expand Down
12 changes: 6 additions & 6 deletions release.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,20 @@ organizationHomepage := Some(url("https://github.com/sfxcode"))

publishMavenStyle := true

homepage := Some(url("https://github.com/sfxcode/simple-mongo"))
homepage := Some(url("https://github.com/sfxcode/mongocamp"))

scmInfo := Some(
ScmInfo(
url("https://github.com/sfxcode/simple-mongo"),
"scm:https://github.com/sfxcode/simple-mongo.git"
url("https://github.com/sfxcode/mongocamp"),
"scm:https://github.com/sfxcode/mongocamp.git"
)
)

developers := List(
Developer(
id = "sfxcode",
id = "mongocamp",
name = "Tom Lamers",
email = "tom@sfxcode.com",
email = "tom@mongocamp.com",
url = url("https://github.com/sfxcode")
)
)
Expand All @@ -33,7 +33,7 @@ publishTo := sonatypePublishToBundle.value
packageOptions += {
Package.ManifestAttributes(
"Created-By" -> "Simple Build Tool",
"Built-By" -> "sfxcode",
"Built-By" -> "mongocamp",
"Build-Jdk" -> System.getProperty("java.version"),
"Specification-Title" -> name.value,
"Specification-Version" -> version.value,
Expand Down
Loading

0 comments on commit bb65f8b

Please sign in to comment.