Describe the bug
Not sure if it's a bug but also don't understand why it's happening. I've got Prisma connected to my MongoDB but when I make any mutations, a new database is being created in MongoDB called default_default and data is being added there instead of the database I specified when going through the setup here
https://www.prisma.io/docs/get-started/01-setting-up-prisma-existing-database-JAVASCRIPT-a003/
Here is my docker-compose.yml
version: '3'
services:
prisma:
image: prismagraphql/prisma:1.23
restart: always
ports:
- "4466:4466"
environment:
PRISMA_CONFIG: |
port: 4466
# uncomment the next line and provide the env var PRISMA_MANAGEMENT_API_SECRET=my-secret to activate cluster security
# managementApiSecret: my-secret
databases:
default:
connector: mongo
uri: 'mongodb://host.docker.internal:27017/name-of-db'
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Expect data would be added to the db specified in docker-compose.yml
On the docker-compose file, you set up the Prisma container as follows:
version: '3'
services:
prisma:
image: prismagraphql/prisma:1.23
restart: always
ports:
- "4466:4466"
environment:
PRISMA_CONFIG: |
port: 4466
# uncomment the next line and provide the env var PRISMA_MANAGEMENT_API_SECRET=my-secret to activate cluster security
# managementApiSecret: my-secret
databases:
default:
connector: mongo
uri: 'mongodb://host.docker.internal:27017/admin'
You need to specify the database to use on the endpoint property of your prisma.yml file.
datamodel: database.prisma
endpoint: http://localhost:4466/app/alpha
databaseType: document
If you deploy to the endpoint above, Prisma will create the database: app_alpha. If you don't specify the path, the default database name is default_default
You will need to provide database in the config like so:
version: '3'
services:
prisma:
image: prismagraphql/prisma:1.23
restart: always
ports:
- "4466:4466"
environment:
PRISMA_CONFIG: |
port: 4466
# uncomment the next line and provide the env var PRISMA_MANAGEMENT_API_SECRET=my-secret to activate cluster security
# managementApiSecret: my-secret
databases:
default:
database: name-of-db
connector: mongo
uri: 'mongodb://host.docker.internal:27017/name-of-db'
uri: 'mongodb://host.docker.internal:27017/admin'
note: 'host.docker.internal' is only useful for mac
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 10 days if no further activity occurs. Thank you for your contributions.