-
-
Notifications
You must be signed in to change notification settings - Fork 913
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
after .write() new values can't be read #449
Comments
I solved this issue by moving the code a bit (though I find it a bit hacky to do it this way, if anyone knows a better option, please let me know)
|
Thanks for the update 👍 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi,
Adding a user to the lowdb works fine. The registration function works. I see the user in db.json.
db.get('users').push({ email: email, password: hash}).write();
However when trying to access the file in another function, the values retrieved are from an old state of the database. see sample code:
How can I ensure the file sync works over all my .js files and is using the most recent state change.
The text was updated successfully, but these errors were encountered: