alexellis / alexellis/mongodb-function
MongoError: command insert requires authentication
- 主要语言
- JavaScript
- 星标
- 53
- 派生
- 7
- PR 合并指标
- 30 天内没有已合并 PR
描述
### 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
```
贡献指南
这个仓库没有索引到贡献指南
评估
这个 Issue 还没有评估数据。