This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mongo "mongodb+srv://sandbox-felrd.mongodb.net/test" --username m001-student | |
pwd: m001-mongodb-basics | |
load("loadMovieDetailsDataset.js") | |
use video | |
db.getCollectionInfos() | |
db.getCollectionInfos( { name: "movieDetails" } ) | |
var data = db.movieDetails.findOne(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo " | |
storage: | |
dbPath: /var/mongodb/db/node1 | |
net: | |
bindIp: 192.168.103.100,127.0.1.1,localhost | |
port: 27011 | |
security: | |
authorization: enabled | |
keyFile: /var/mongodb/pki/m103-keyfile | |
systemLog: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wget https://s3.amazonaws.com/edu-downloads.10gen.com/M001_2018_May/static/handouts/m001_comparisonOperators.js | |
wget https://s3.amazonaws.com/edu-downloads.10gen.com/M001_2018_May/static/handouts/m001_element_operators.js | |
wget https://s3.amazonaws.com/edu-downloads.10gen.com/M001_2018_May/static/handouts/m001_logical_operators.js | |
wget https://s3.amazonaws.com/edu-downloads.10gen.com/M001_2018_May/static/handouts/m001_all_operator.js | |
wget https://s3.amazonaws.com/edu-downloads.10gen.com/M001_2018_May/static/handouts/m001_size_operator.js | |
wget https://s3.amazonaws.com/edu-downloads.10gen.com/M001_2018_May/static/handouts/m001_elemMatch_operator.js | |
wget https://s3.amazonaws.com/edu-downloads.10gen.com/M001_2018_May/static/handouts/m001_regex_operator.js | |
mongo "mongodb+srv://sandbox-felrd.mongodb.net/test" --username m001-student | |
pwd: m001-mongodb-basics |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Final Exam | |
/* | |
Which of the following are valid command line instructions to start a mongod? | |
You may assume that all specified files already exist. | |
*/ | |
mongod -f /etc/mongod.conf # ok |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Setting Up a Sharded Cluster | |
Lab - Configure a Sharded Cluster | |
*/ | |
create keyfile | |
# openssl rand -base64 741 > /var/mongodb/pki/m103-keyfile | |
rm -rf /var/mongodb/db/{node1,node2,node3} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Section 1: Philosophy & Features: | |
1. Which of the following does MongoDB use to provide High Availability and fault tolerance? | |
a. Write Concern # Write concern describes the level of acknowledgement requested from MongoDB for write operations to a standalone mongod or to replica sets or to sharded clusters. In sharded clusters, mongos instances will pass the write concern on to the shards. | |
* b. Replication # provê o HA | |
c. Sharding # é a distribuição do dado | |
d. Indexing # index |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
How to unzip gz file using Python | |
https://stackoverflow.com/questions/31028815/how-to-unzip-gz-file-using-python | |
import pandas as pd | |
import os | |
fn = '../data/file_to_load.json.gz' | |
print(os.path.isfile(fn)) | |
df = pd.read_json(fn, lines=True, compression='gzip') | |
df.tail() |
cd /home/training/udacity_training
[training@localhost udacity_training]$ head -50 data/purchases.txt | ./code/mapper.py | sort | ./code/reducer.py
[training@localhost udacity_training]$ pwd
/home/training/udacity_training
Filtering * Sampling * Top-N * Simple Filter * Bloom Filter ()
- Sampling