src/Database/MongoProvider.js
/**
     * Updates the given guild in the DB with a new schema object.
     *
     * @param {String} gID - Guid id
     * @param {GuildConfig|GuildConfigRaw} data - the schema object to update
     * @returns {Promise<GuildConfig|null>} Updated GuildConfig from the DB
     * @memberof MongoProvider
     */
Updates the given guild in the DB with a new schema object.
@param {String} gID - Guid id
@param {GuildConfig|GuildConfigRaw} data - the schema object to update
@returns {Promise} Updated GuildConfig from the DB
@memberof MongoProvider
Updates the given guild in the DB with a new schema object . @param { String } gID - Guid id @param { GuildConfig|GuildConfigRaw } data - the schema object to update @returns { Promise } Updated GuildConfig from the DB @memberof MongoProvider
async saveGuild(gID, data) {
        data.updatedAt = new Date();
        const res = await this.GuildSchema.findOneAndUpdate( {
            guildID: gID,
        },
        data,
        {
            new: true,
            upsert: true,
            setDefaultsOnInsert: true,
        } ).lean().exec();
        return res && new this.GuildConfig(this.axon, res);
    }
async saveGuild ( gID , data ) { data . updatedAt = new Date ( ) ; const res = await this . GuildSchema . findOneAndUpdate ( { guildID : gID , } , data , { new : true , upsert : true , setDefaultsOnInsert : true , } ) . lean ( ) . exec ( ) ; return res && new this . GuildConfig ( this . axon , res ) ; }
Updates the given guild in the DB with a new schema object.
Updates the given guild in the DB with a new schema object .