The communications platform that puts data protection first.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Rocket.Chat/packages/rocketchat-lib/client/models/_Base.js

53 lines
851 B

RocketChat.models._Base = class {
_baseName() {
return 'rocketchat_';
}
_initModel(name) {
check(name, String);
return this.model = new Mongo.Collection(this._baseName() + name);
}
find() {
return this.model.find.apply(this.model, arguments);
}
findOne() {
return this.model.findOne.apply(this.model, arguments);
}
insert() {
return this.model.insert.apply(this.model, arguments);
}
update() {
return this.model.update.apply(this.model, arguments);
}
upsert() {
return this.model.upsert.apply(this.model, arguments);
}
remove() {
return this.model.remove.apply(this.model, arguments);
}
allow() {
return this.model.allow.apply(this.model, arguments);
}
deny() {
return this.model.deny.apply(this.model, arguments);
}
ensureIndex() {}
dropIndex() {}
tryEnsureIndex() {}
tryDropIndex() {}
};