These are chat archives for Automattic/mongoose

Aug 2016
Aug 02 2016 01:39
Hello !

I have this error showing :

Mongoose: mpromise (mongoose's default promise library) is deprecated

Tried to fix it doing like they said in the issue here : Automattic/mongoose#4291
Right before calling connect :

mongoose.Promise = global.Promise;

It didn't fix it.

Vlado Tesanovic
Aug 02 2016 08:05
@manonthemoon42 Are you sure that you are using it in proper way? Seams ok
Vlado Tesanovic
Aug 02 2016 08:12

Anyone using here Mongoose with TypeScript? I am having problem to define Type of mongoose.model<IPost>("Post", schema);

What i put now is : type PostModel = Model<IPost> & IPostModel;

But TypeScript compiler is complaining when i latter in code put his:
const post: PostModel = new Post();

with: Initializer type Model<IPost> is not assignable to variable type PostModel

Aug 02 2016 11:51
@manonthemoon42 Make sure you are are only using the one connection, otherwise the error will be reported for any other connections opened elsewhere that have not had that set against them.
Aravind Suresh
Aug 02 2016 18:49
hi can someone suggest me the best mongoose auto increment library
Aug 02 2016 20:40
Can someone tell me why this won't work?
     {"input": "$_id",
     "as": "id",
     "cond": {$gte: ["$$id", mongoose.Types.ObjectId("57a0dc1ba62a6f01612f42a9").getTimestamp()]