feat: api will plugin mongoMeili without a valid connection

This commit is contained in:
Daniel Avila 2023-03-21 20:06:27 -04:00
parent 94c0fbb525
commit 194051e424
7 changed files with 167 additions and 144 deletions

View file

@ -49,16 +49,16 @@ const configSchema = mongoose.Schema(
);
// Instance method
ConfigSchema.methods.incrementCount = function () {
configSchema.methods.incrementCount = function () {
this.startupCounts += 1;
};
// Static methods
ConfigSchema.statics.findByTag = async function (tag) {
configSchema.statics.findByTag = async function (tag) {
return await this.findOne({ tag });
};
ConfigSchema.statics.updateByTag = async function (tag, update) {
configSchema.statics.updateByTag = async function (tag, update) {
return await this.findOneAndUpdate({ tag }, update, { new: true });
};