Recoger información de MongoDB como Number
This commit is contained in:
parent
f9adc3f592
commit
8d5349fd45
@ -87,7 +87,7 @@ public class LineaDaoMongoDB implements ILineaDAO{
|
||||
Document docColor= new Document();
|
||||
docColor.append("cod_color", linea.getColor().getCodigo())
|
||||
.append("nombre", linea.getColor().getNombre())
|
||||
.append("cod_hexxadecimal", linea.getColor().getCodHexadecimal());
|
||||
.append("cod_hexadecimal", linea.getColor().getCodHexadecimal());
|
||||
docLineaActualizado.append("color", docColor);
|
||||
|
||||
coleccionMongoDB.updateOne(filtro, new Document("$set", docLineaActualizado));
|
||||
@ -106,8 +106,9 @@ public class LineaDaoMongoDB implements ILineaDAO{
|
||||
int idMongoDB = documentoLinea.getInteger("_id");
|
||||
String nombreCorto = documentoLinea.getString("nombre_corto");
|
||||
String nombreLargo= documentoLinea.getString("nombre_corto");
|
||||
Decimal128 kilometrosDecimal128 = documentoLinea.get("kilometros", Decimal128.class);
|
||||
BigDecimal kilometros = kilometrosDecimal128.bigDecimalValue();
|
||||
Number numberKilometros = documentoLinea.get("kilometros", Number.class);
|
||||
|
||||
BigDecimal kilometros = BigDecimal.valueOf(numberKilometros.doubleValue());
|
||||
|
||||
Document documentoColor= (Document) documentoLinea.get("color");
|
||||
int codigoColor = documentoColor.getInteger("cod_color");
|
||||
|
||||
@ -1,11 +1,11 @@
|
||||
# Información sobre la Base de datos MySQL
|
||||
driver.sgdb=com.mysql.cj.jdbc.Driver
|
||||
url.bbdd=jdbc:mysql://172.16.0.181:3306/red_metro
|
||||
url.bbdd=jdbc:mysql://10.11.218.147:3306/red_metro
|
||||
usuario.sgdb=root
|
||||
clave.sgdb=mysql_123
|
||||
|
||||
# Información sobre la Base de datos MongoDB
|
||||
url.conexion.mongodb=mongodb://admin:mongodb_123@172.16.0.181:27017
|
||||
url.conexion.mongodb=mongodb://localhost:27017
|
||||
bbdd.mongodb=red_metro
|
||||
|
||||
# Información sobre Estaciones (XML)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user