草庐IT

ENV_NAME

全部标签

c# - 数据库 'Database Name' 的凭据无效。 MongoDB 2.6.2

我正在使用monogdb2.6.2并尝试在monogdb服务器中创建管理员用户帐户。用户详情如下:-我可以在Mongoshell中使用这些数据库凭据访问任何数据库,但是当我尝试通过应用程序使用相同的数据库凭据时,我收到了一个错误。数据库“数据库名称”的凭据无效数据库连接字符串:-"mongodb://admin:admin@localhost:27011";有人可以帮忙吗?提前致谢。更新:请查看尝试在数据库中创建新集合的两种方法。现在,当我尝试使用相同的用户名和密码登录时,即-uadmin-padmin,mongoshell给我未授权用户错误。然后我用新的用户名和密码创建了一个新用户-

javascript - Mongoose 和node.js中的TypeError : [function name] is not a function,

我是node.js和Mongoose的新手,如果有人能帮助我解决以下错误,我将不胜感激。我通过以下函数发出放置请求(该函数的要点是“赞成”论坛帖子。o.upvote=function(post){return$http.put('/posts/'+post._id+'/upvote').success(function(data){post.upvotes+=1;});};这又转到我的路线:index.js(我的路线)router.put('/posts/:post/upvote',function(req,res,next){req.post.upvote(function(err,

Node.js MongoDB 创建多个索引 : no index name specified

我正在使用MongoDB版本2.6.11如何解决这个错误?在Node.jsAPIreference您可以传递的唯一参数是一个索引规范数组和一个回调函数,我应该在哪里指定索引名称?我正在使用的代码如下(假设我已经需要mongoclient并已连接到数据库):db.collection("MyCollection").createIndexes([{field1:1},{field2:1,field3:1}],function(err,result){//Errorhandlingcode});错误代码为67,错误的完整堆栈跟踪如下:MongoError:noindexnamespecif

javascript - 错误 : name":"Invariant Violation" ,"framesToPop":1

我看到了这个奇怪的错误。我正在编写一个应用程序,它使用图形api从facebook检索事件详细信息。该事件有几个属性:-所有者,它是一个包含所有者ID、所有者名称和其他属性的对象-cover代表事件封面图像细节的对象。我将事件保存在mongo数据库中,这是我的事件模型:constEventSchema=newSchema({title:String,name:String,_id:{type:String,unique:true,default:shortid.generate,},start_time:Date,end_time:Date,description:String,own

Flutter的The file name ‘xxxx.dart‘ isn‘t a snake_case identifier警告

文章目录警告原因分析解决方法dart的一些命名规则变量和函数命名:类和类型命名:常量和枚举:文件命名:包命名:注释:命名一致性:避免缩写:可搜索的命名:一些好习惯警告Thefilename‘xxxx.dart’isn’tasnake_caseidentifier原因分析这个警告指的是文件名‘appRouter.dart’不符合Dart命名约定中的“snake_case”命名规则。在Dart中,通常使用“snake_case”命名规则来命名文件、变量、函数等标识符。解决方法“snake_case”命名规则要求将多个单词用下划线_连接,并且全小写,例如my_file.dart或my_functio

node.js - fatal error : Schema hasn't been registered for model "a". 使用 mongoose.model(name, schema)

我有以下错误:Fatalerror:Schemahasn'tbeenregisteredformodel"a".Usemongoose.model(name,schema)这是我的文件结构:--------a.model.js--------'usestrict';varmongoose=require('mongoose'),Schema=mongoose.Schema;varA=newSchema({name:String,});module.exports=mongoose.model('A',A);--------b.model.js--------'usestrict';va

node.js - GraphQL 错误 : Must provide name

我正在编写用于在NodeJS中登录用户的突变。它给出错误“必须提供名称”。这是浏览器GraphQL查询:mutation{login(username:"dfgdfg",password:"test1234"){_id,name{fname,lname,mname}}}这是我的代码constlogin={type:UserType,args:{input:{name:'Input',type:newGraphQLNonNull(newGraphQLObjectType({username:{name:'Username',type:newGraphQLNonNull(GraphQLSt

javascript - 无法读取未定义的属性 'user_first_name'

我正在尝试使用expressjs/mongoose注册用户,但出现以下错误:TypeError:Cannotreadproperty'user_first_name'ofundefinedatC:\QuizwebPolitica\server.js:20:24atLayer.handle[ashandle_request](C:\QuizwebPolitica\node_modules\express\lib\router\layer.js:95:5)atnext(C:\QuizwebPolitica\node_modules\express\lib\router\route.js:1

javascript - jest-jasmine2 env.js 未处理的错误

我在使用Jest单元测试来测试我的代码时收到这条神秘的错误消息。console.errornode_modules/jest-jasmine2/build/jasmine/Env.js:198Unhandlederrorconsole.errornode_modules/jest-jasmine2/build/jasmine/Env.js:199Erroratmodel.wrappedPointCut[assave](/home/pi/dev/Group_2/node_modules/mongoose/lib/services/model/applyHooks.js:131:29)at

django.core.exceptions.ImproperlyConfigured : name must be an instance of basestring

我正在尝试在我的Django中使用Mongodb。下面是settings.py中的连接设置DEBUG=TrueTEMPLATE_DEBUG=DEBUGADMINS=(#('YourName','your_email@example.com'),)MANAGERS=ADMINSDATABASES={'default':{'ENGINE':'django_mongodb_engine','NAME':'','USER':'','PASSWORD':'','HOST':'localhost','PORT':27017,}}当我尝试运行pythonmanage.pysyncdb时,出现如下错误