stijnsanders / TMongoWire

Delphi MongoDB driver
MIT License
102 stars 37 forks source link

Demo mwx2 does not delete properly #19

Closed JohnHofland closed 10 years ago

JohnHofland commented 10 years ago

Not sure if this is the right place to make this comment but the 2nd demo does not remove the chunks. Therefore I modified the function inside mwx2Main to:

procedure TForm1.btnDeleteClick(Sender: TObject); var li:TListItem; begin li:=ListView1.Selected; if li<>nil then if MessageBox(Handle,PChar('Are you sure to delete "'+li.Caption+'"?'), 'mwx2',MB_OKCANCEL or MB_ICONQUESTION)=idOK then begin FDB.Delete(FilesCollection+'.files',BSON(['_id',li.SubItems[siID]])); FDB.Delete(FilesCollection+'.chunks',BSON(['files_id',li.SubItems[siID]])); //Added li.Delete; end; end;

This seems to do the trick

stijnsanders commented 10 years ago

Yes this would be the right place to raise the issue. Thank you for your suggestion. Please see this commit: https://github.com/stijnsanders/TMongoWire/commit/c93fff2179ecd121f7de48d9c77588485fb1df32