邮件架构:
var mail = new mongoose.Schema({
globalId: {type: String, index: true, unique: true},
from: {type: String, required: true},
beginDate: {type: Date, required: true},
endDate: {type: Date},
source: {type: String},
address: {type: String},
subject: {type: String, required: true},
text: {type: String},
note: {type: String},
files: [
{
fileName: {type: String},
fileSize: {type: Number},
fileType: {type: String}
}
]
});
Run Code Online (Sandbox Code Playgroud)
当我尝试保存 endDate 为空的新邮件时,出现以下错误
Mail validation failed: endDate: Cast to Date failed for value "null"
Run Code Online (Sandbox Code Playgroud) 我正在尝试使用 android.util.Base64 对字符串进行编码和解码,但它给出了一个糟糕的 base-64 错误。
String str = "EOKF36syRBtB11VgyChkNjc1HxRrajT7XXaxZfnVzPkV57K3b9yqkS284Ovb9uWzXgGeY2bxA3IySGfdOHiPAQ==F/v6hcTiU1sd975XHfDsz8o0rboujM77n7KwRMidobOLbo5ghUT/IFcxElUc8CirdZxaCaS3zs/CfRKRsXwbFNYd";
Base64.decode(str,Base64.NO_WRAP);
Run Code Online (Sandbox Code Playgroud)
我正在尝试使用以下标志(NO_CLOSE、DEFAULT、NO_PADDING、URL_SAFE)解码字符串,但它给出了相同的错误。
请帮我解决我的问题。