Skip to content

Commit

Permalink
Added a method to update guildSchema
Browse files Browse the repository at this point in the history
  • Loading branch information
Khaaz committed Aug 12, 2018
1 parent c752396 commit 47315d5
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/Database/MongoService.js
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,26 @@ class MongoService {
static saveSchema(schema) {
return schema.save();
}

/**
* Save Guild Schema
*
* @static
* @param {String} gID - Guid id
* @param {Object} schema - Guild Schema to save
* @returns {Promise} Updated SChema111
* @memberof MongoService
*/
static saveGuildSchema(gID, schema) {
return Guild.findOneAndUpdate({
guildID : gID,
},
schema,
{
new: true,
upsert: true,
});
}
}

export default MongoService;

0 comments on commit 47315d5

Please sign in to comment.