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

56 lines
944 B

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