華為雲 mongodb 4.0.3 mongodb diver 2.12.4 c# 代碼連接,連接字符串密碼包含%,因阿里雲控制台提示修改密碼可以包含:特殊字符% #
但代碼連接會報: Unable to authenticate using sasl protocol mechanism SCRAM-SHA-256. 無法使用sasl協議機制SCRAM-SHA-256進行身份驗證 這個信息
MongodbConnectString": "mongodb://rwuser:7Jb322OwB#Wk6%C@ip:8635",
navicat p 客戶端連接mongodb不會報這個錯誤
刪除集合的腳本:
use("colltest");
db.getCollectionNames().forEach(function(ColName){
var re1=new RegExp(".*_BizLog$");
var re2=new RegExp(".*_Listing$");
if(!re1.test(ColName)&&!re2.test(ColName))
{
return;
}
print(db[ColName]);
});
1、刪除colltest庫下以"_BizLog."和“_Listing.”開頭的集合
M_Express_Listing_BizLog
Ap_Publish_Wish_Listing