wixData.save() deleted entire database

I have been working on a fairly large dataset. I just had to add a field and save data to the dataset collection via an api call. The data was returned and I used the .save() function to update the field that I wanted to populate data into. Since I did not want to update everything I just saved the _id of the item and the data object that was returned from my API.

As a result of running this all the information was just deleted from my collection. Including the data that I was trying to save

Is there a way to get the data back? And what is the best way to update just one field once I have the data back?

Hello. Automatic backups happen every 7 days for live data assuming there was a change to the data. You can also setup manual backups.

Take a look at this article for information on restoring backup and how the auto and manual backups work

I thought of something else that may be useful to you in the future. Have you worked with the sandbox collections? This is a great option for testing data operations on your collections without affecting the live data.

About Sandbox and Live Collections

Thank you. I was able to restore from the backup successfully. I read about sandbox collections after this happened. Definitely going to be using that a lot more going foreword.

1 Like

@amotor Glad it worked out! I’ve def had many database panic moments in my life. If there are any other questions you have about testing and dev lifecycle tips, let us know

Also, if you believe that behavior was a bug please report it and steps to recreate for support to take a look