alexellis / alexellis/mongodb-function

MongoError: command insert requires authentication

未关闭
#4 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
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 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。