Open armand1m opened 7 years ago
Hi,
Right now, I have no bandwidth to update this package (due to my job), but I plan to complete it. Unfortunately, I'm not able to give any deadline :/
But, If you want to submit MR, I'll be pleased to check it
Hey guys, are there any changes about supporting discriminators?
Hi, first of all, thanks for this package. Seems an interesting alternative to mongoosastic.
I'm currently having a trouble in mongoosastic (and I've actually opened this issue in their repo as well.)
I'm building a blogging platform. This blogging platform has 3 entities basic:
Publication is a mongoose schema with its own model. It has the primary keys needed for a publication such as: title, category, sources, etc.
InternalPublication and House are Publication discriminators. They live in the same collection in the database, but have different keys and are instantiated as different models in the application and have their schemas separated. These have some keys related to the publication itself.
The problem is, when I try to add the
mongoosastic
plugin to thePublication
schema, it successfully handlesInternalPublication
andHouse
post hooks, but when persisted to Elastic, it only persists the keys related to thePublication schema
, and forget about all the fields related toInternalPublication
or `House.When I try to add the
mongoosastic
plugin toInternalPublication
orHouse
, it persists the only the schema keys, and forget about the discriminator parent.I believe this has something to do with the fact that mongoosastic handles only schemas, and discriminators are defined at a model level. Does we have any ways of working with discriminators with this library?