Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
Introduction to MongoDB
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
William Bell
Introduction to MongoDB
Commits
89619808
Commit
89619808
authored
5 months ago
by
William Bell
Browse files
Options
Downloads
Patches
Plain Diff
Adding docker-compose.yml together with associated changes
parent
fe79711b
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
README.md
+20
-1
20 additions, 1 deletion
README.md
python/mongo_connect.py
+2
-2
2 additions, 2 deletions
python/mongo_connect.py
with
22 additions
and
3 deletions
README.md
+
20
−
1
View file @
89619808
# Introduction to MongoDB
An introduction to the MongoDB NoSQL database using the Python interface.
An introduction to the MongoDB NoSQL database using the
`pymongo`
Python module.
*
Documentation is given in
[
doc/introduction-to-mongo.pdf
](
doc/introduction-to-mongo.pdf
)
.
*
Example programs are given in
[
python/
](
python/
)
.
*
The
`docker-compose.yml`
file can be used with
[
docker compose
](
https://docs.docker.com/compose/
)
to start MongoDB locally.
```
bash
# Start the MongoDB server.
docker compose up
# Press ctrl-c to stop the running server.
# Remove the mongodb container.
docker compose down
--rmi
local
# Remove the mongodb image from the local PC.
docker compose down
--rmi
all
```
\ No newline at end of file
This diff is collapsed.
Click to expand it.
python/mongo_connect.py
+
2
−
2
View file @
89619808
...
...
@@ -13,8 +13,8 @@ def get_client():
server
=
os
.
getenv
(
'
MONGODB_SERVER
'
,
'
localhost
'
)
port_str
=
os
.
getenv
(
'
MONGODB_PORT
'
,
'
27017
'
)
username
=
os
.
getenv
(
'
MONGODB_USERNAME
'
,
''
)
password
=
os
.
getenv
(
'
MONGODB_PASSWD
'
,
''
)
username
=
os
.
getenv
(
'
MONGODB_USERNAME
'
,
'
root
'
)
password
=
os
.
getenv
(
'
MONGODB_PASSWD
'
,
'
example
'
)
# The port number should be an integer.
try
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment