MarcelloDB icon indicating copy to clipboard operation
MarcelloDB copied to clipboard

We should be able to clear all MarcelloDB storage

Open bed007 opened this issue 7 years ago • 4 comments

We need to be able to wipe out the entire MarcelloDB storage content to be able to fresh start without having to uninstall / reinstall the application.

Since the Session object take a rootPath, I think the "Wipeout" method should be exposed on the Session object.

bed007 avatar Jul 14 '17 19:07 bed007

+1 Currenly I need to loop through whole collection, retrieve entities ID's, and then call Destroy, one by one.

Szymaniuk avatar Jul 17 '17 13:07 Szymaniuk

@bed007 Thank you for reporting this issue. You are right, MarcelloDB currently has no way of destroying all data at once.

However, there is a really simple way to do this. MarcelloDB stores files in the folder which was used to open the session. Every collectionFile is a file in that folder, and the filename is the name used to create the collection file.

So the simplest way to delete all the data (or specific collection files) is to Dispose the session and delete the files from the folder.

markmeeus avatar Jul 17 '17 14:07 markmeeus

To be be implemented at the CollectionFile level.

session["my_data"].ClearAllCollections();

markmeeus avatar Aug 22 '17 14:08 markmeeus

Any news on this? :-)

DevEddy avatar Jun 02 '20 10:06 DevEddy