-
Notifications
You must be signed in to change notification settings - Fork 0
/
chapter_3.html
60 lines (43 loc) · 2.4 KB
/
chapter_3.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
Chapter 3. Python - MongoDB
<div class="container">
<div class="divider"></div>
<P>Python can be used in database applications.<br>
One of the most popular NoSQL database is MongoDB.</P>
<H5>MongoDB</H5>
<p>MongoDB stores data in JSON-like documents, which makes the database very flexible and scalable.<br>
To be able to experiment with the code examples in this tutorial, you will need access to a MongoDB database. <br>
You can download a free MongoDB database at <a href="https://www.mongodb.com">mongoDB</a></p>
<div class="divider"></div>
<H5>PyMongo</H5>
<p>Python needs a MongoDB driver to access the MongoDB database. <br>
In this tutorial we will use the MongoDB driver "PyMongo".<br>
We recommend that you use PIP to install "PyMongo".<br>
PIP is most likely already installed in your Python environment.<br>
Navigate your command line to the location of PIP, and type the following:</p>
<div class="row">
<div class="card-panel grey lighten-5 z-depth-1">
<div class="row valign-wrapper">
<div class="col s12">
<p>C:\Users\Your Name\AppData\Local\Programs\Python\Python36-32\Scripts>python -m pip install pymongo</div>
</div>
</div>
</div>
<p>Now you have downloaded and installed a mongoDB driver.</p>
<div class="divider"></div>
<H5>Test PyMongo</H5>
<p>To test if the installation was successful, or if you already have "pymongo" installed, create a Python page with the following content:</p>
<div class="row">
<div class="card-panel grey lighten-5 z-depth-1">
<div class="row valign-wrapper">
<div class="col s12">
<p>import pymongo</div>
</div>
</div>
</div>
<p>If the above code was executed with no errors, "pymongo" is installed and ready to be used.</p>
<div class="divider"></div>
<div class="row"></div>
<div class="video-container">
<iframe width="560" height="315" src="https://www.youtube.com/embed/E-1xI85Zog8" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
</div>
</div>