#!/usr/bin/env bash

# Usuwamy bazę danych
mongo stock-www --host db-stock --eval "db.dropDatabase()"

# Importujemy oferty
mongoimport --host db-stock -d stock-www -c offers --file /project/docker/data/offers.json

# Tworzymy index
mongo stock-www --host db-stock --eval "db.offers.createIndex({ 'dealer.coordinates': '2dsphere' })"