代码改变世界

mongodb shell设置

2022-12-26 10:58  ndzj  阅读(35)  评论(0编辑  收藏  举报

host=db.serverStatus().host;
cmdCount=1;
prompt=function(){
return db+"@"+host+" "+(cmdCount++) +">";
}

function showDate(){

var today = new Date();
var year = today.getFullYear() + "年";
var month = (today.getMonth() +1) + "月";
var date = today.getDate() + "日";
var week = '星期' + today.getDay();
var quarter = "一年中的第" + Math.floor((today.getMonth() +3) / 3) + "个季度";

var text = "欢迎回来,今天是" + year + month + date + week +"," + quarter + "。";
print(text);

}

showDate();