阅读Mongo:明确指南:
在第一章中,作者提到以下代码片段来更改一些默认命令db
:
var no = function() {
print("Not on my watch.");
};
// Prevent dropping databases
db.dropDatabase = DB.prototype.dropDatabase = no;
// Prevent dropping collections
DBCollection.prototype.drop = no;
// Prevent dropping an index
DBCollection.prototype.dropIndex = no;
// Prevent dropping indexes
DBCollection.prototype.dropIndexes = no;
我知道db
指向当前数据库,但我的问题是它DB
来自哪里?