Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: mongo deprecated warning #649

Merged
merged 1 commit into from
Jan 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions .idea/twikoo.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/.vitepress/theme/Twikoo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,6 @@ onMounted(() => {

<!-- Twikoo -->
<div id="twikoo"></div>
<component :is="'script'" src="https://cdn.jsdelivr.net/npm/twikoo@1.6.30/dist/twikoo.min.js" ref="twikooJs"></component>
<component :is="'script'" src="https://cdn.jsdelivr.net/npm/twikoo@1.6.31/dist/twikoo.min.js" ref="twikooJs"></component>
</div>
</template>
2 changes: 1 addition & 1 deletion docs/backend.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ exports.main = require('twikoo-func').main
8. 创建完成后,点击“twikoo"进入云函数详情页,进入“函数代码”标签,点击“文件 - 新建文件”,输入 `package.json`,回车
9. 复制以下代码、粘贴到代码框中,点击“保存并安装依赖”
``` json
{ "dependencies": { "twikoo-func": "1.6.30" } }
{ "dependencies": { "twikoo-func": "1.6.31" } }
```

## 腾讯云命令行部署
Expand Down
10 changes: 5 additions & 5 deletions docs/frontend.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ twikoo:

``` html
<div id="tcomment"></div>
<script src="https://cdn.staticfile.org/twikoo/1.6.30/twikoo.all.min.js"></script>
<script src="https://cdn.staticfile.org/twikoo/1.6.31/twikoo.all.min.js"></script>
<script>
twikoo.init({
envId: '您的环境id', // 腾讯云环境填 envId;Vercel 环境填地址(https://xxx.vercel.app)
Expand All @@ -103,10 +103,10 @@ twikoo.init({

如果遇到默认 CDN 加载速度缓慢,可更换其他 CDN 镜像。以下为可供选择的公共 CDN,其中一些 CDN 可能需要数天时间同步最新版本:

* `https://cdn.staticfile.org/twikoo/1.6.30/twikoo.all.min.js`
* `https://lib.baomitu.com/twikoo/1.6.30/twikoo.all.min.js`
* `https://cdn.bootcdn.net/ajax/libs/twikoo/1.6.30/twikoo.all.min.js`
* `https://cdn.jsdelivr.net/npm/twikoo@1.6.30/dist/twikoo.all.min.js`
* `https://cdn.staticfile.org/twikoo/1.6.31/twikoo.all.min.js`
* `https://lib.baomitu.com/twikoo/1.6.31/twikoo.all.min.js`
* `https://cdn.bootcdn.net/ajax/libs/twikoo/1.6.31/twikoo.all.min.js`
* `https://cdn.jsdelivr.net/npm/twikoo@1.6.31/dist/twikoo.all.min.js`

## 开启管理面板(腾讯云环境)

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "twikoo",
"version": "1.6.30",
"version": "1.6.31",
"description": "A simple comment system.",
"keywords": [
"twikoojs",
Expand Down
2 changes: 1 addition & 1 deletion src/client/version.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
const version = '1.6.30'
const version = '1.6.31'

export { version }
2 changes: 1 addition & 1 deletion src/server/function/twikoo/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "twikoo-func",
"version": "1.6.30",
"version": "1.6.31",
"description": "A simple comment system.",
"author": "imaegoo <hello@imaegoo.com> (https://github.com/imaegoo)",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion src/server/netlify/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "twikoo-netlify",
"version": "1.6.30",
"version": "1.6.31",
"description": "A simple comment system.",
"author": "imaegoo <hello@imaegoo.com> (https://github.com/imaegoo)",
"license": "MIT",
Expand Down
5 changes: 1 addition & 4 deletions src/server/self-hosted/mongo.js
Original file line number Diff line number Diff line change
Expand Up @@ -205,10 +205,7 @@ async function connectToDatabase (uri) {
if (!uri) throw new Error('未设置环境变量 MONGODB_URI | MONGO_URL')
// If no connection is cached, create a new one
logger.info('Connecting to database...')
const client = await MongoClient.connect(uri, {
useNewUrlParser: true,
useUnifiedTopology: true
})
const client = await MongoClient.connect(uri, {})
// Select the database through the connection,
// using the database path of the connection string
const dbName = (new URL(uri)).pathname.substring(1) || 'twikoo'
Expand Down
4 changes: 2 additions & 2 deletions src/server/self-hosted/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "tkserver",
"version": "1.6.30",
"version": "1.6.31",
"description": "A simple comment system.",
"keywords": [
"twikoo",
Expand Down Expand Up @@ -31,7 +31,7 @@
"get-user-ip": "^1.0.1",
"lokijs": "^1.5.12",
"mongodb": "^6.3.0",
"twikoo-func": "1.6.30",
"twikoo-func": "1.6.31",
"uuid": "^8.3.2"
}
}
4 changes: 2 additions & 2 deletions src/server/vercel/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "twikoo-vercel",
"version": "1.6.30",
"version": "1.6.31",
"description": "A simple comment system.",
"author": "imaegoo <hello@imaegoo.com> (https://github.com/imaegoo)",
"license": "MIT",
Expand All @@ -13,7 +13,7 @@
"dependencies": {
"get-user-ip": "^1.0.1",
"mongodb": "^6.3.0",
"twikoo-func": "1.6.30",
"twikoo-func": "1.6.31",
"uuid": "^8.3.2"
}
}
Loading