- Obtener el instalador para Windows del centro de descargas.
- Iniciar el instalador como administrador.
- Crear las carpeta de almacenamiento y configuracion de MongoDB.
- Dar permisos escritura y lectura a estas carpetas.
C:\data
C:\data\db
| // After some time looking around 'mongoose issues' i found this link: | |
| // https://github.com/Automattic/mongoose/issues/5399 | |
| // As you can see this message is a kind of bug, i tried the first possible answer to fix it | |
| // Also create a test document, just to check if the connection and model works | |
| // | |
| // Stack: | |
| // node: v7.10.0 | |
| // npm: 5.0.4 | |
| // nodemon: 1.11.0 | |
| // mongoose: 4.11.1 |
| mongod.exe --storageEngine=mmapv1 |
| Exception in initAndListen: 28663 Cannot start server. | |
| The default storage engine 'wiredTiger' is not available with this build of mongod. | |
| Please specify a different storage engine explicitly, e.g. --storageEngine=mmapv1., terminating |
C:\data
C:\data\db
Para resolver este ejercicio se utilizara el 'mongo shell' de MongoDB.
Debe conectarse a una instancia activa de mongod, se puede utilizar una base de datos llamada mongo_exercise.
Documentar todas sus consultas en un archivo javascript para usar como referencia.
| # Avoid this command | |
| node index.js | |
| # Using nodemon package | |
| npm install -g nodemon | |
| npm config get prefix | |
| ls -la /usr/local | |
| ls -la /usr/local/lib | |
| sudo chown -R $(whoami) $(npm config get prefix)/{lib/node_modules,bin,share} | |
| npm install nodemon -g | |
| nodemon -v |