我正在尝试找出此代码中发生的事情。我正在遵循本教程:

问题描述 投票:0回答:2
VSCODE输出图像

如果我删除了“新”,我会明白:

VSCODE第二输出图像

    

您应该进口:

mongoose ,也仅定义您的模型一次:

node.js mongodb mongoose
2个回答
0
投票

我想与您分享我的解决方案,或者至少对我有用的东西。


var userSchema = mongoose.Schema({ name: String, password: String, email:String }); module.exports = mongoose.model("Users", userSchema);


0
投票

最新问题
© www.soinside.com 2019 - 2025. All rights reserved.