message: fix: now using existingConnection instead of existingMongoose
diff: @@ -13,17 +13,16 @@ export type InstanceType<T> = T & mongoose.Document;
  export type ModelType<T> = mongoose.Model<InstanceType<T>> & T;
  export interface GetModelForClassOptions {
  - existingMongoose?: mongoose.Mongoose;
  + existingMongoose?: mongoose.Mongoose; // TODO deprecated
  schemaOptions?: mongoose.SchemaOptions;
  + existingConnection?: mongoose.Connection;
  }
  export class Typegoose {
  - getModelForClass<T>(t: T, { existingMongoose, schemaOptions }: GetModelForClassOptions = {}) {
  + getModelForClass<T>(t: T, { existingMongoose, schemaOptions, existingConnection }: GetModelForClassOptions = {}) {
  const name = (this.constructor as any).name;
  if (!models[name]) {
  - const Schema = existingMongoose ?
  - existingMongoose.Schema.bind(existingMongoose) :
  - mongoose.Schema.bind(mongoose);
  + const Schema = mongoose.Schema;
  const sch = schemaOptions ?
  new Schema(schema[name], schemaOptions) :
  @@ -38,11 +37,11 @@ export class Typegoose {
  if (hooks[name]) {
  const preHooks = hooks[name].pre;
  preHooks.forEach((preHookArgs) => {
  - sch.pre(...preHookArgs);
  + (sch as any).pre(...preHookArgs);
  });
  const postHooks = hooks[name].post;
  postHooks.forEach((postHookArgs) => {
  - sch.post(...postHookArgs);
  + (sch as any).post(...postHookArgs);
  });
  }
  @@ -62,8 +61,8 @@ export class Typegoose {
  }
  });
  - const model = existingMongoose ?
  - existingMongoose.model.bind(existingMongoose) :
  + const model = existingConnection ?
  + existingConnection.model.bind(existingConnection) :
  mongoose.model.bind(mongoose);
  models[name] = model(name, sch);
  