Update app.py
Browse files
app.py
CHANGED
|
@@ -58,6 +58,14 @@ try:
|
|
| 58 |
# Prueba de conexi贸n
|
| 59 |
mongo_client.server_info()
|
| 60 |
print("Conexi贸n a MongoDB API exitosa")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 61 |
except Exception as e:
|
| 62 |
print(f"Error al conectar con MongoDB API: {str(e)}")
|
| 63 |
raise
|
|
|
|
| 58 |
# Prueba de conexi贸n
|
| 59 |
mongo_client.server_info()
|
| 60 |
print("Conexi贸n a MongoDB API exitosa")
|
| 61 |
+
|
| 62 |
+
#Verificar que la colecci贸n existe
|
| 63 |
+
# Verificar que la colecci贸n existe
|
| 64 |
+
if 'text_analysis' in mongo_db.list_collection_names():
|
| 65 |
+
print("Colecci贸n 'text_analysis' encontrada")
|
| 66 |
+
else:
|
| 67 |
+
print("Advertencia: La colecci贸n 'text_analysis' no existe. Se crear谩 autom谩ticamente al insertar el primer documento.")
|
| 68 |
+
|
| 69 |
except Exception as e:
|
| 70 |
print(f"Error al conectar con MongoDB API: {str(e)}")
|
| 71 |
raise
|