mongoolia
mongoolia copied to clipboard
Inconsistent behavior with mongoose 5
I am running mongoolia with mongoose 5.2.8
. syncWithAlgolia()
works fine some times, other times it errors with doc.pushToAlgolia is not a function
reproduction here: https://github.com/bakery/algolia-mongoose-5
your code seems to be correct; do you know what kind of use cases you have in which it errors?
if you just rerun this a few times in a row - it starts throwing that doc.pushToAlgolia is not a function
error pretty randomly, as far as i can tell. now, given that the DB gets wiped out on every run, it might have smth to do with that but i would expect syncWithAlgolia
to handle this in a consistent manner
Hi @callmephilip
This library is meant to be used with mongoose v4. I did not tested it for mongoose v5.
I'll submit a PR to add a notice about versions support.
@iam4x should i open a ticket regarding v5 support then?
I think this issue if fine.
But, I'm not sure this will be fixed anytime soon. I'm not working with Mongoose anymore and I'm full time working on my startup.
Maybe some Algolian will take some time to debug this? Or you might want to debug it and make a PR 👍
@iam4x gotcha, thanks. i'll take a look to see if it's something i could tackle
Somehow changing doc.pushToAlgolia to doc.addObjectToAlgolia in algolia-mongoose-model.js made it work with [email protected]
I haven't read the code well enough to understand why this worked, just wanted to point it out.