Cómo descargar e instalar MongoDB on Windows y nube

⚡ Resumen inteligente

Cómo descargar e instalar MongoDB on Windows and Cloud is explained as a complete setup guide. This resource covers installing MongoDB Community Server on Windows, JavaTexto, Python, and Ruby drivers, MongoDB Compass, configuration with import and export, a config file, and deploying MongoDB Atlas on the cloud.

  • 🪟 Windows Instalar: Download the 64-bit Community Server and run the MSI installer.
  • ???? Controladores: JavaScript ships built in; add Python (pymongo) and Ruby (mongo) drivers.
  • 🧭 Brújula: Instale la MongoDB Compass GUI to manage databases visually.
  • ⚙️ Configuración: Set the data directory, import/export CSV, and use a config file.
  • ☁️ nube: Despliegue MongoDB Atlas on AWS, Google Cloud, o Azure and connect a client.

Cómo descargar e instalar MongoDB

Los instaladores de MongoDB are available in both the 32-bit and 64-bit format. The 32-bit installers are good for development and test environments. But for production environments you should use the 64-bit installers. Otherwise, you can be limited in the amount of data that can be stored within MongoDB. It is advisable to always use the stable release for production environments.

Cómo descargar e instalar MongoDB on Windows

Los siguientes pasos se pueden utilizar para descargar e instalar MongoDB on Windows 10:

Paso 1) Descargar MongoDB Community Server

Vaya a la este enlace y descarga MongoDB Servidor comunitario. Instalaremos la versión de 64 bits para Windows.

Descargar e instalar MongoDB on Windows

Paso 2) Haga clic en Configuración

Once the download is complete, open the msi file. Click Next in the start-up screen.

Descargar e instalar MongoDB on Windows

Paso 3) Acepte el Acuerdo de licencia de usuario final

  1. Acepte el Acuerdo de licencia de usuario final.
  2. Haga clic en Siguiente.

Descargar e instalar MongoDB on Windows

Step 4) Click on the “Complete” button

Click on the “Complete” button to install all of the components. The custom option can be used to install selective components or if you want to change the location of the installation.

Descargar e instalar MongoDB on Windows

Paso 5) Configuración del servicio

  1. Select “Run service as Network Service user”. Make a note of the data directory; we will need this later.
  2. Haga clic en Siguiente.

Descargar e instalar MongoDB on Windows

Paso 6) Iniciar el proceso de instalación

Haga clic en el botón Instalar para iniciar la instalación.

Descargar e instalar MongoDB on Windows

Step 7) Click Next once completed

Installation begins. Click Next once completed.

Descargar e instalar MongoDB on Windows

Paso 8) Haga clic en el botón Finalizar

Final step: once the installation is complete, click on the Finish button.

Descargar e instalar MongoDB on Windows

Hola Mundo MongoDB: JavaControlador de script

Conductores en MongoDB are used for connectivity between client applications and the database. For example, if you had a Java programa y requirió que se conectara a MongoDB, then you would require to download and integrate the Java controlador para que el programa pueda funcionar con el MongoDB base de datos.

el conductor para JavaScript sale de la caja. MongoDB shell which is used to work with the MongoDB database is actually a JavaScript shell. To access it:

Paso 1) Go to “C:\Program Files\MongoDB\Server\4.0\bin” y haga doble clic en mongo.exe. Alternativamente, también puede hacer clic en el MongoDB desktop item.

Hola Mundo MongoDB: JavaControlador de script

Paso 2) Enter the following program into the shell:

var myMessage='Hello World';
printjson(myMessage);

Hola Mundo MongoDB: JavaControlador de script

Code Explicación:

  1. Sólo estamos declarando una simple JavaScript variable to store a string called ‘Hello World’.
  2. Estamos utilizando el método printjson para imprimir la variable en la pantalla.

Instale Python Destornillador

Paso 1) Asegúrese de que Python is installed on the system.

Paso 2) Install the mongo related drivers by issuing the below command:

pip install pymongo

Instalar el controlador Ruby

Paso 1) Ensure Ruby is installed on the system.

Paso 2) Ensure gems is updated by issuing the command:

gem update --system

Paso 3) Install the mongo related drivers by issuing the below command:

gem install mongo

Instale MongoDB Compass – MongoDB Herramienta de administracion

Existen en el mercado herramientas disponibles para gestionar MongoDB. Una de esas herramientas no comerciales es MongoDB Compass. Some of the features of Compass are given below:

  1. Full power of the Mongo shell
  2. Múltiples conchas
  3. Múltiples resultados

Paso 1) Vaya a la este enlace and click download.

Instale  MongoDB Compass

Paso 2) Enter details in the popup and click submit.

Instale  MongoDB Compass

Paso 3) Double click on the downloaded file.

Instale  MongoDB Compass

Paso 4) Installation will auto-start.

Instale  MongoDB Compass

Paso 5) Compass will launch with a Welcome screen.

Instale  MongoDB Compass

Paso 6) Keep the privacy settings as default and click “Start Using Compass”.

Instale  MongoDB Compass

Paso 7) You will see the home screen with a list of current databases.

Instale  MongoDB Compass

MongoDB Configuración, importación y exportación

Antes de iniciar el MongoDB servidor, el primer aspecto clave es configurar el directorio de datos donde se encuentran todos los MongoDB data will be stored. This can be done in the following way:

MongoDB Configuración, importación y exportación

El comando anterior 'md \data\db' crea un directorio llamado \data\db en su ubicación actual. MongoDB creará automáticamente las bases de datos en esta ubicación, porque esta es la ubicación predeterminada para MongoDB para almacenar su información. Simplemente nos estamos asegurando de que el directorio esté presente, para que MongoDB Puede encontrarlo cuando comienza.

La importación de datos a MongoDB Esto se hace con el comando “mongoimport”. El siguiente ejemplo muestra cómo se puede hacer.

Paso 1) Create a CSV file called data.csv and put the following data in it:

Employeeid,EmployeeName
1,Guru99
2,Mohan
3,Smith

So in the above example, we are assuming we want to import 3 documents into a collection called data. The first row is called the header line, which will become the field names of the collection.

Paso 2) Issue the mongoimport command.

MongoDB Configuración, importación y exportación

Code Explicación:

  1. We are specifying the db option to say which database the data should be imported to.
  2. The type option is to specify that we are importing a csv file.
  3. Remember that the first row is called the header line, which will become the field names of the collection; that is why we specify the –headerline option. And then we specify our data.csv file.

Resultado

MongoDB Configuración, importación y exportación

El resultado muestra claramente que se importaron 3 documentos a MongoDB.

Exportación MongoDB is done by using the mongoexport command.

MongoDB Configuración, importación y exportación

Code Explicación:

  1. Estamos especificando la opción db para indicar desde qué base de datos se deben exportar los datos.
  2. We are specifying the collection option to say which collection to use.
  3. The third option is to specify that we want to export to a csv file.
  4. El cuarto es especificar qué campos de la colección deben exportarse.
  5. La opción –out especifica el nombre del archivo csv al que exportar los datos.

Resultado

MongoDB Configuración, importación y exportación

El resultado muestra claramente que se exportaron 3 registros desde MongoDB.

Configurando MongoDB servidor con archivo de configuración

One can configure the mongod server instance to start up with a configuration file. The configuration file contains settings that are equivalent to the mongod command-line options. For example, suppose you wanted MongoDB to store all its logging information to a custom location, then follow the below steps:

Paso 1) Create a file called “mongod.conf” and store the below information in the file.

Configurando MongoDB Servidor con archivo de configuración

  1. The first line of the file specifies that we want to add configuration for the system log file, that is where the information about what the server is doing goes, in a custom log file.
  2. La segunda opción es mencionar que la ubicación será un archivo.
  3. This mentions the location of the log file.
  4. LogAppend: "true" significa garantizar que la información de registro se siga agregando al archivo de registro. Si pone el valor como "falso", el archivo se eliminará y se creará de nuevo cada vez que el servidor se inicie nuevamente.

Paso 2) Start the mongod server process and specify the above created configuration file as a parameter. The screenshot of how this can be done is shown below.

Configurando MongoDB Servidor con archivo de configuración

Once the above command is executed, the server process will start using this configuration file, and if you go to the /etc directory on your system, you will see the mongod.log file created. The below snapshot shows an example of what a log file would look like.

Configurando MongoDB Servidor con archivo de configuración

Cómo instalar MongoDB en la nube (AWS, Google, Azure)

You do not need to install the MongoDB server and configure it. You can deploy a MongoDB Servidor Atlas en la nube en plataformas como AWS, Google Cloud, y Azure, and connect to the instance using a client. Below are the detailed steps:

Paso 1) Vaya a la este enlace.

  1. Ingrese sus datos personales
  2. Está de acuerdo con los términos
  3. Click the button “Get Started Free”

Instale  MongoDB en la nube

Paso 2) Click “Build my first cluster”.

Instale  MongoDB en la nube

Paso 3) Puede seleccionar entre AWS, Google Cloud, y Azure as your cloud provider. In this tutorial, we will use AWS, which is set by default. Make no other changes on the page and click “Create Cluster.

Instale  MongoDB en la nube

Paso 4) Cluster creation takes some time.

Instale  MongoDB en la nube

Paso 5) After some time you will see the cluster ready.

Instale  MongoDB en la nube

Paso 6) Click Security > Add new user.

Instale  MongoDB en la nube

Paso 7) En la siguiente pantalla:

  1. Introduzca las credenciales de usuario
  2. Asignar privilegios
  3. Click the Add User button

Instale  MongoDB en la nube

Paso 8) In the dashboard, click the connect button.

  1. Incluya en la lista blanca su conexión IP
  2. Elige el método de conexión

Instale  MongoDB en la nube

Paso 9) Select the connection method of your choice to connect to the MongoDB servidor.

Instale  MongoDB en la nube

Preguntas Frecuentes

Yes. AI assistants can generate mongod configuration files, explain connection errors, and suggest fixes for driver or service issues. You should still verify commands against the official MongoDB documentation before applying them.

Sí. MongoDB Atlas includes Atlas Vector Search and AI integrations that let you build semantic search and retrieval-augmented generation apps. It stores embeddings alongside documents, removing the need for a separate vector database.

Sí. MongoDB Community Server is free and open source for Windows, macOSy Linux. MongoDB Atlas also provides a free cloud tier, while Enterprise Edition adds paid advanced features and support.

Community Server is installed and managed on your own machine or server. Atlas is a fully managed cloud service that handles setup, scaling, backups, and security on AWS, Google Cloud, o Azure.

Resumir este post con: