Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
mongodb-orders
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
Model registry
Operate
Environments
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
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
joel.vonderwe
mongodb-orders
Commits
d45d4e12
Commit
d45d4e12
authored
5 years ago
by
Joel Cavat
Browse files
Options
Downloads
Patches
Plain Diff
Update readme with two options
parent
d28d6345
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
README.md
+32
-4
32 additions, 4 deletions
README.md
docker-compose-with-node.yml
+16
-0
16 additions, 0 deletions
docker-compose-with-node.yml
docker-compose.yml
+0
-6
0 additions, 6 deletions
docker-compose.yml
with
48 additions
and
10 deletions
README.md
+
32
−
4
View file @
d45d4e12
# TP MongoDB
## Start docker
### Option 1 (mongo containerized, node locally)
build and run MongoDB and Node.js API with
`orders.json`
dump:
```
...
...
@@ -17,6 +24,14 @@ use mongodb (mongo shell):
docker-compose exec mongo-orders mongo admin
```
### Option 2 (mongo and node containerized)
```
js
docker
-
compose
-
f
docker
-
compose
-
with
-
node
.
yml
up
--
build
-
d
```
## Use MongoDB
in mongodb shell:
```
js
...
...
@@ -46,12 +61,24 @@ db.orders.find().map( obj => obj.vendors );
```
## Serveur HTTP
## Use a HTTP Serveur (optional)
### Using node locally (option 1)
```
js
cd
api
npm
install
npm
start
```
API in Node.js available, example route http://localhost:3000/by-customer-pseudo/A
**
D
### Using node locally (option 2)
API
in Node.js available, example route
http://localhost:8080/by-customer-pseudo/A
**
D
API
already available at
http://localhost:8080/by-customer-pseudo/A
**
D
## Missions
# Missions
### Contraintes
...
...
@@ -68,7 +95,8 @@ API in Node.js available, example route http://localhost:8080/by-customer-pseudo
6.
pour chaque client (id et pseudo), comptez le nombre de commandes
7.
pour chaque vendeur, comptez le chiffre d'affaire (indication:
`$unwind`
)
## Vos solutions
# Vos solutions
### requête 1
...
...
This diff is collapsed.
Click to expand it.
docker-compose-with-node.yml
0 → 100644
+
16
−
0
View file @
d45d4e12
version
:
'
2'
services
:
mongo-orders
:
image
:
mongo
ports
:
-
'
27017:27017'
mongo-seed
:
build
:
./mongodb
depends_on
:
-
mongo-orders
api
:
build
:
./api
ports
:
-
'
8080:8080'
depends_on
:
-
mongo-orders
This diff is collapsed.
Click to expand it.
docker-compose.yml
+
0
−
6
View file @
d45d4e12
...
...
@@ -8,9 +8,3 @@ services:
build
:
./mongodb
depends_on
:
-
mongo-orders
api
:
build
:
./api
ports
:
-
'
8080:8080'
depends_on
:
-
mongo-orders
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