Skip to content

Commit 21da08c

Browse files
committed
update to mongo scala driver 2.4.0
1 parent ab249a5 commit 21da08c

File tree

6 files changed

+14
-10
lines changed

6 files changed

+14
-10
lines changed

CHANGES.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22

33
## Versions
44

5+
### 1.3.1
6+
* update mongo-scala-driver to 2.4.0
7+
* Operations Base count method support CountOptions
8+
9+
510
### 1.3.0
611

712
* Crud refactoring

build.sbt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ buildInfoOptions += BuildInfoOption.BuildTime
2323

2424
// Test
2525

26-
libraryDependencies += "org.specs2" %% "specs2-core" % "4.2.0" % "test"
26+
libraryDependencies += "org.specs2" %% "specs2-core" % "4.3.0" % "test"
2727

2828
libraryDependencies += "ch.qos.logback" % "logback-classic" % "1.2.3" % "test"
2929

@@ -33,8 +33,7 @@ libraryDependencies += "joda-time" % "joda-time" % "2.10" % "test"
3333

3434
libraryDependencies += "org.json4s" %% "json4s-native" % "3.5.4" % "test"
3535

36-
libraryDependencies += "org.mongodb.scala" %% "mongo-scala-driver" % "2.3.0"
37-
36+
libraryDependencies += "org.mongodb.scala" %% "mongo-scala-driver" % "2.4.0"
3837

3938
libraryDependencies += "com.typesafe.scala-logging" %% "scala-logging" % "3.9.0"
4039

project/plugin.sbt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ addSbtPlugin("com.typesafe.sbt" % "sbt-ghpages" % "0.6.2")
1818

1919
addSbtPlugin("io.github.jonas" % "sbt-paradox-material-theme" % "0.4.0")
2020

21-
addSbtPlugin("com.lightbend.paradox" % "sbt-paradox" % "0.3.3")
21+
addSbtPlugin("com.lightbend.paradox" % "sbt-paradox" % "0.3.5")
2222

23-
addSbtPlugin("com.github.gseitz" % "sbt-release" % "1.0.8")
23+
addSbtPlugin("com.github.gseitz" % "sbt-release" % "1.0.9")
2424

2525

src/main/scala/com/sfxcode/nosql/mongo/bson/BsonConverter.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package com.sfxcode.nosql.mongo.bson
22

33
import java.math.BigInteger
4-
import java.time.{LocalDate, LocalDateTime, ZoneId}
4+
import java.time.{ LocalDate, LocalDateTime, ZoneId }
55
import java.util.Date
66

77
import org.mongodb.scala.Document

src/main/scala/com/sfxcode/nosql/mongo/operation/Base.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package com.sfxcode.nosql.mongo.operation
33
import com.sfxcode.nosql.mongo._
44
import com.typesafe.scalalogging.LazyLogging
55
import org.mongodb.scala.bson.conversions.Bson
6-
import org.mongodb.scala.model.IndexOptions
6+
import org.mongodb.scala.model.{ CountOptions, IndexOptions }
77
import org.mongodb.scala.model.Sorts._
88
import org.mongodb.scala.{ Completed, Document, MongoCollection, Observable, Observer, SingleObservable }
99

@@ -13,9 +13,9 @@ abstract class Base[A]()(implicit ct: ClassTag[A]) extends LazyLogging {
1313

1414
protected def coll: MongoCollection[A]
1515

16-
def count(filter: Bson = Document()): Observable[Long] = coll.count(filter)
16+
def count(filter: Bson = Document(), options: CountOptions = CountOptions()): Observable[Long] = coll.countDocuments(filter)
1717

18-
def countResult(filter: Bson = Document()): Long = count(filter)
18+
def countResult(filter: Bson = Document(), options: CountOptions = CountOptions()): Long = count(filter, options)
1919

2020
def drop(): Observable[Completed] = coll.drop()
2121

src/test/scala/com/sfxcode/nosql/mongo/TestDatabase.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ object TestDatabase extends ObservableImplicits {
3232

3333
val persons: List[Person] = Person.personList
3434

35-
PersonDAO.insertManyResult(persons)
35+
PersonDAO.insertMany(persons).head()
3636

3737
def printDatabaseStatus(): Unit = {
3838
printDebugValues("Database Status", "%s rows for collection person found".format(PersonDAO.countResult()))

0 commit comments

Comments
 (0)