From 5c6be895e4471431413315825a5071b2c1863622 Mon Sep 17 00:00:00 2001 From: David Eder Date: Sat, 1 May 2021 14:46:10 +0200 Subject: [PATCH] Add mongo scenario data --- components/entitiy_ident/mongo/Dockerfile | 8 ++++++++ components/entitiy_ident/mongo/cars.json | 17 +++++++++++++++++ components/entitiy_ident/mongo/import.sh | 4 ++++ .../entitiy_ident/mongo/traffic_lights.json | 16 ++++++++++++++++ 4 files changed, 45 insertions(+) create mode 100644 components/entitiy_ident/mongo/Dockerfile create mode 100644 components/entitiy_ident/mongo/cars.json create mode 100644 components/entitiy_ident/mongo/import.sh create mode 100644 components/entitiy_ident/mongo/traffic_lights.json diff --git a/components/entitiy_ident/mongo/Dockerfile b/components/entitiy_ident/mongo/Dockerfile new file mode 100644 index 0000000..20803ee --- /dev/null +++ b/components/entitiy_ident/mongo/Dockerfile @@ -0,0 +1,8 @@ +FROM mongo:4.4 + +COPY ./import.sh . +COPY ./cars.json . +COPY ./traffic_lights.json . + +ADD import.sh /docker-entrypoint-initdb.d + diff --git a/components/entitiy_ident/mongo/cars.json b/components/entitiy_ident/mongo/cars.json new file mode 100644 index 0000000..a7fbc0e --- /dev/null +++ b/components/entitiy_ident/mongo/cars.json @@ -0,0 +1,17 @@ +[ + { + "oem": "BENTLEY", + "modelType": "Continental", + "vin": "SCBFR7ZA5CC072256" + }, + { + "oem": "SATURN", + "modelType": "Vue", + "vin": "5GZCZ43D13S812715" + }, + { + "oem": "SATURN", + "modelType": "Vue2", + "vin": "5GZCZ43D13S812715" + } +] \ No newline at end of file diff --git a/components/entitiy_ident/mongo/import.sh b/components/entitiy_ident/mongo/import.sh new file mode 100644 index 0000000..ec22493 --- /dev/null +++ b/components/entitiy_ident/mongo/import.sh @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +mongoimport --db entities --collection cars --type json --file cars.json --jsonArray +mongoimport --db entities --collection trafficLights --type json --file traffic_lights.json --jsonArray diff --git a/components/entitiy_ident/mongo/traffic_lights.json b/components/entitiy_ident/mongo/traffic_lights.json new file mode 100644 index 0000000..e464166 --- /dev/null +++ b/components/entitiy_ident/mongo/traffic_lights.json @@ -0,0 +1,16 @@ +[ + { + "id": "1", + "location": { + "type": "Point", + "coordinates": [-73.856077, 40.848447] + } + }, + { + "id": "2", + "location": { + "type": "Point", + "coordinates": [-73.856077, 40.848447] + } + } +] \ No newline at end of file