We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d9039df commit 306693aCopy full SHA for 306693a
src/main/scala/com/sfxcode/nosql/mongo/package.scala
@@ -46,7 +46,7 @@ package object mongo extends MongoIncludes with DocumentIncludes {
46
val value = getValue(key)
47
value match {
48
case n: Number => n.longValue()
49
- case s: String => s.toLongOption.getOrElse(0)
+ case s: String => s.toLong
50
case _ => 0
51
}
52
@@ -56,7 +56,7 @@ package object mongo extends MongoIncludes with DocumentIncludes {
56
def getDoubleValue(key: String): Double =
57
getValue(key) match {
58
case n: Number => n.doubleValue()
59
- case s: String => s.toDoubleOption.getOrElse(0)
+ case s: String => s.toDouble
60
61
62
0 commit comments