1-Mongo使用维护资料汇总

常用加索引-命令举例:
 db.getCollection('s_statistics_player_amt').createIndex({target_type:1,target_id:1,team_id:1},{name: "target_type_1_target_id_1_team_id_1",background: true});
db.getCollection('b_statistics_player').createIndex({player_id:1,target_type:1},{name: "player_id_1_target_type_1",background: true});


1.mongo是文档型数据库,不能join

2.mongosql语法文档:


3,mongo执行计划语法文档:
mongodb explain("executionStats")
Mongodb索引及explain: 
Mongodb索引及explain_executionstats.executionstages.inputstage_qq_41084438的博客-CSDN博客

4.代码中使用JDBC

MongoDB使用JDBC连接_mongodb jdbc_Jwbasta的博客-CSDN博客

5.mongo补数据, 用客户端手动补数据

用其他表的数据来补数据

把文档名称改为 想补数据的 目的表的表名

5.报错排查处理

com.mongodb.MongoCommandException: Command failed with error 18 (AuthenticationFailed): 'Authentication failed.' on server localhost:27017. The full response is { "ok" : 0.0, "errmsg" : "Authentication failed.", "code" : 18, "codeName" : "AuthenticationFailed" }

这个最后排查结果为: 我程序的连接数据库的账号密码被改了, 密码错误

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值