Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistent behavior with mongoose 5 #5

Open
callmephilip opened this issue Aug 16, 2018 · 7 comments
Open

Inconsistent behavior with mongoose 5 #5

callmephilip opened this issue Aug 16, 2018 · 7 comments

Comments

@callmephilip
Copy link

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

@Haroenv
Copy link

Haroenv commented Aug 16, 2018

your code seems to be correct; do you know what kind of use cases you have in which it errors?

@callmephilip
Copy link
Author

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

@iam4x
Copy link
Contributor

iam4x commented Aug 16, 2018

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.

@callmephilip
Copy link
Author

@iam4x should i open a ticket regarding v5 support then?

@iam4x
Copy link
Contributor

iam4x commented Aug 17, 2018

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 👍

@callmephilip
Copy link
Author

@iam4x gotcha, thanks. i'll take a look to see if it's something i could tackle

@johancc
Copy link

johancc commented Aug 23, 2020

Somehow changing doc.pushToAlgolia to doc.addObjectToAlgolia in algolia-mongoose-model.js made it work with [email protected]
Annotation 2020-08-22 235157
I haven't read the code well enough to understand why this worked, just wanted to point it out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants