Typegoose: The Typegoose Class is deprecated ?

Created on 10 Dec 2019  路  4Comments  路  Source: typegoose/typegoose


(node:15344) DeprecationWarning: The Typegoose Class is deprecated, please try to remove it

I use Typegoose like this, just test...

import { Typegoose, prop } from '@typegoose/typegoose';
export class exemplegoose extends Typegoose {

    @prop()
    sheeps: String;

    @prop()
    wolves: Number;

}
const exemplegoose = getModelForClass(exemplegoose);

And later, i bind exemplegoose to a route create ...

Versions

  • @types/mongoose: ^5.5.32
  • mongoose: ^5.8.0
  • typegoose: ^5.9.1

Env

  • npm: 6.13.0
  • node: 12.13.1

Why node advice me to drop typegoose use ? 馃檮 its scare me 馃槗

mongoose.connect(appSettings.Run.local.url.mongodb, { useNewUrlParser: true, useUnifiedTopology: true, dbName:'Feanaro'})
  .then(() => console.log('馃捑 Service base de donn茅e 馃摳馃捑...'))
  .catch(((err: any) => { console.log(err); }));
question

Most helpful comment

i should note that you use the old typegoose-npm package, use @typegoose/typegoose for 6.0, and anything <6.0 is not supported anymore - but this message was not in 5.x

All 4 comments

https://typegoose.github.io/typegoose/guides/migrate-to-6/#getmodelforclass-setmodelforclass-buildschema

the Typegoose class got deprecated, because it is just unnecessary - just remove extends Typegoose then it should vanish & work

PS: are you sure you are on 5.9.1? because this message only appears on 6.0+

its sure. copy paste ... so sure 100%

package

i should note that you use the old typegoose-npm package, use @typegoose/typegoose for 6.0, and anything <6.0 is not supported anymore - but this message was not in 5.x

i will close this because it is for a version that is not supported anymore

Was this page helpful?
0 / 5 - 0 ratings