These are chat archives for Automattic/mongoose

28th
May 2018
panigrah
@panigrah
May 28 2018 01:10
@asmi77 can you find the uploaded file on your hard disk? Make sure it’s getting uploaded. And then it depends on how your server is configured to serve static files. I don’t think it’s a mongoose issued
asmi77
@asmi77
May 28 2018 10:44
@panigrah yes it is, it is uploaded both on my hard disk, and my database (this form : uploads/2018-05-27T18:53:56.811Zsofa.jpg). About the static files, I don't see exactly what you mean, can you give me more details ? Thank you.
asmi77
@asmi77
May 28 2018 11:20
Thank you @lineus , I'll have a look on it
Altiano Gerung
@Altiano
May 28 2018 12:36

What is the best way to have Polymorphism in mongoose?

Right now, I just create a field that only exist if a record is a child class. The field is of object type.

Looking at official driver in C# (http://mongodb.github.io/mongo-csharp-driver/2.5/reference/bson/mapping/polymorphism/).
It seams like this is the best way. Probably the author(s) might consider using such pattern?

Kev
@lineus
May 28 2018 12:38
have you looked at mongoose discriminators @Altiano ?