All Downloads are FREE. Search and download functionalities are using the official Maven repository.

dev.mongocamp.driver.mongodb.database.DatabaseInfo.scala Maven / Gradle / Ivy

There is a newer version: 2.8.1
Show newest version
package dev.mongocamp.driver.mongodb.database

import java.util.Date
import dev.mongocamp.driver.mongodb._

import org.mongodb.scala.bson.Document

case class DatabaseInfo(name: String, sizeOnDisk: Double, empty: Boolean, fetched: Date, map: Map[String, Any])

object DatabaseInfo {

  def apply(document: Document): DatabaseInfo = {
    val name       = document.getString("name")
    val sizeOnDisk = document.getValue("sizeOnDisk").asInstanceOf[Number].doubleValue()
    val empty      = document.getBoolean("empty")
    DatabaseInfo(name, sizeOnDisk, empty, new Date(), document.asPlainMap)

  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy