Skip to content
#

code

Here are 415 public repositories matching this topic...

ccforward
ccforward commented Apr 3, 2017

[半夜改bug] mongoose 的 createConnection 和 connect

代码出 bug 大半夜的被 mongoose 的连接函数搞惨

因为代码里 mongo 数据库的连接方式的代码被改成了 const db = mongoose.createConnection(mongo.url(), mongoOptions),所以在调用数据插入函数时 Promise 的 resolve 和 reject 都没有返回,也没有打印任何异常信息。

查了业务逻辑、本地 mongo 的读写都没问题,最后发现是 mongo 的连接文件 connect.js 被修改了。

因为用了 mongoose.createConnection 所以此时的 model 应该是 db.mongoose.model('Product')

而之前的是用默认的

gsilvamartin
gsilvamartin commented Dec 23, 2019

Is your feature request related to a problem? Please describe.

When the code is not found it opens the same default code editing page.

Describe the solution you'd like

Implement a page where it informs the user that the code was not found and shows the question if he wants to create a code with that name entered.

tunnckoCore
tunnckoCore commented Sep 21, 2019

Hey @jonschlinkert :)

The comment's code.context is an empty object when using export default, arrow function.

/**
 * Foobar 1 with default export arrow function and typescript
 * and empty code.context
 *
 * @param  {string} `commit` a commit message
 * @api public
 */

export default (commit: string): Commit => {};

/**
 * Foobar 2 with default export arrow function
rickwest
rickwest commented Oct 4, 2019

We need more snippets adding! This is a great way to get started contributing to Hacktoberfest and Open Source in general.

There are no hard and fast rules here, so please feel free to contribute by opening a pull request adding your snippet.

If you aren't sure what might be suitable, check out projects like DevHints for inspiration.

Instructions for adding a snip

Improve this page

Add a description, image, and links to the code topic page so that developers can more easily learn about it.

Curate this topic

Add this topic to your repo

To associate your repository with the code topic, visit your repo's landing page and select "manage topics."

Learn more

You can’t perform that action at this time.