diff options
author | Mathias Stearn <mathias@10gen.com> | 2009-10-14 18:19:14 -0400 |
---|---|---|
committer | Mathias Stearn <mathias@10gen.com> | 2009-10-14 18:19:14 -0400 |
commit | 468b56691b91b16dd2f109b9e12ec7df316db084 (patch) | |
tree | 3a3b283e04a53ed8e00cd75845c0e332a794b8f9 | |
parent | 5bcc5521bb19e0ffff21ae8a6baa6763a00207c2 (diff) | |
download | mongo-468b56691b91b16dd2f109b9e12ec7df316db084.tar.gz |
add delete command to mongofiles
-rw-r--r-- | tools/files.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tools/files.cpp b/tools/files.cpp index b9d26010465..b35416bd591 100644 --- a/tools/files.cpp +++ b/tools/files.cpp @@ -56,6 +56,7 @@ public: out << " which listed filenames must contain." << endl; out << " put - add a file with filename 'gridfs filename'" << endl; out << " get - get a file with filename 'gridfs filename'" << endl; + out << " delete - delete all files with filename 'gridfs filename'" << endl; } void display( GridFS * grid , BSONObj obj ){ @@ -128,6 +129,12 @@ public: return 0; } + if ( cmd == "delete" ){ + g.removeFile(filename); + cout << "done!"; + return 0; + } + cerr << "ERROR: unknown command '" << cmd << "'" << endl << endl; printHelp(cout); return -1; |