Aquesta és una revisió antiga del document
Chapter 2 : The MongoDB Query Language + Atlas
CRUD
- Create
- Read
- Update
- Delete
Installing the mongo Shell
Compass no cobre toda las opciones que da MongoDB
windows
- download center
- instalar MongoDB Server versión enterprise (soporte SSL?) para acceder a Atlas Cluster
c:\Program Files\MongoDB\Server\3.4mongo –nodb→quit()
osx/linux
- descargar
- modificar path
conexión
mongo "mongodb://cluster0-shard-00-00-jxeqq.mongodb.net:27017,cluster0-shard-00-01-jxeqq.mongodb.net:27017,cluster0-shard-00-02-jxeqq.mongodb.net:27017/test?replicaSet=Cluster0-shard-0" --authenticationDatabase admin --ssl --username m001-student --password m001-mongodb-basics
- cluster, le indicamos todos los servers
- test es la DB a la que le indicamos que queremos conectar, la iremos cambiando, por ejemplo: 100YWeatherSmall
use videoshow collectionsdb.movies.find().pretty()
Lab2
- crear cuenta en Atlas
- creación cluster en AWS (free tier)
- settings
- project name: *M001*
- Security
- IP Whitelist → Allow access from anywhere
- MongoDB Users → new user
- user: *m001-student*
- pass: *m001-mongodb-basics*
Connecting to your sandbox cluster from mongo shell
- desde Atlas GUI, Overview → Connect
- usar mongodb-shell connection
- v3.4+
mongo "mongodb://sandbox-shard-00-00-cab0l.mongodb.net:27017,sandbox-shard-00-01-cab0l.mongodb.net:27017,sandbox-shard-00-02-cab0l.mongodb.net:27017/test?replicaSet=Sandbox-shard-0" --ssl --authenticationDatabase admin --username m001-student --password m001-mongodb-basics