Skip to content

Commit

Permalink
Merge pull request #16 from UTT-GL03/main
Browse files Browse the repository at this point in the history
Sync
  • Loading branch information
Asmeeeee authored Dec 3, 2024
2 parents a21f608 + ab4e695 commit 1b9fad0
Show file tree
Hide file tree
Showing 8 changed files with 414,590 additions and 144,740 deletions.
9 changes: 9 additions & 0 deletions backend/by_date.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"index": {
"fields": [
{"meteo.date": "asc"}
]
},
"name": "by_date",
"type": "json"
}
10 changes: 10 additions & 0 deletions backend/view.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"_id": "_design/testCity",
"views": {
"city": {
"map": "function (doc) {\n emit(doc.city);\n}",
"reduce": "_count"
}
},
"language": "javascript"
}
14 changes: 14 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,20 @@ services:
command:
- |
curl -X POST http://backend:5984/ecometeo/_bulk_docs -H "Content-Type: application/json" -d @/sample_data.json
depends_on:
accessible_backend:
condition: service_completed_successfully

index:
image: curlimages/curl
entrypoint: ["/bin/sh","-c"]
volumes:
- ./backend/by_date.json:/by_date.json
- ./backend/view.json:/view.json
command:
- |
curl -X POST http://backend:5984/ecometeo/_index -H "Content-Type: application/json" -d @/by_date.json -u '${COUCHDB_USER}:${COUCHDB_PASSWORD}'
curl -X POST http://backend:5984/ecometeo -H "Content-Type: application/json" -d @/view.json -u '${COUCHDB_USER}:${COUCHDB_PASSWORD}'
depends_on:
accessible_backend:
condition: service_completed_successfully
Loading

0 comments on commit 1b9fad0

Please sign in to comment.