#Mongoose don't save data

15 messages · Page 1 of 1 (latest)

hybrid spade
#

@brave rune - What version of Mongoose are you using?

hybrid spade
#

Ok. In general, you need to move the return and the .save outside of the for-loop unless you are 100% certain there is only one instance of wasUsed == false in your data. And even then, I'd probably do that differently. What do you return, if the condition isn't met? How did you get creatorData? I'm most interested in that last question to resolve your issue.

brave rune
#

You need to more info?

hybrid spade
#

Lastly, what does your entities look like? Account and TwoFactorBackup?

hybrid spade
#

The classes defining Account and TwoFactorBackup....

brave rune
brave rune
#

If i print the saved it is to true

#

if i refresh database on mongodb compass don't appere change

brave rune
#

@hybrid spade ?

hybrid spade
#

It's hard to say what might be wrong with the info given. And, obviously we have a language barrier to cross too. 🤷🏻‍♂️

hybrid spade
#

Exactly...