static createContextKey(db) {
        let cn = db.$cn;
        if (typeof cn === 'object') {
            const obj = {}, keys = Object.keys(cn).sort();
            keys.forEach(name => {
                obj[name] = cn[name];
            });
            cn = obj;
        }
        return npm.utils.toJson(npm.utils.getSafeConnection(cn)) + npm.utils.toJson(db.$dc);
    }
@method DatabasePool.createContextKey
@static
@description
For connections that are objects it reorders the keys alphabetically,
and then serializes the result into a JSON string.

@param {Database} db - Database instance.