alexellis / alexellis/mongodb-function
MongoError: command insert requires authentication
- Lingua principale
- JavaScript
- Stelle
- 53
- Fork
- 7
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
### Problem
Following instruction in README but I got `MongoError: command insert requires authentication`.
### Suggesting a Solution
I tried to install mogodb with username/password following [stable/mongodb chart](https://github.com/helm/charts/tree/master/stable/mongodb) documentation.
```
$ helm install --name openfaas-db \
--namespace openfaas-fn \
--set persistence.enabled=false,mongodbRootPassword=secretpassword,mongodbUsername=my-user,mongodbPassword=my-password,mongodbDatabase=clients \
stable/mongodb
```
Change two lines of `handle.js` to:
```
const mongoURL = `mongodb://${username}:${password}@${url} + ":27017/clients`
....
MongoClient.connect(mongoURL,{useNewUrlParser: true, useUnifiedTopology: true} ,...
```
Change `stack.yml`:
```
url: openfaas-db-mongodb.openfaas-fn.svc.cluster.local
username: my-user
password: my-password
```
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Valutazione
Questa issue non è ancora stata valutata.