diff --git a/client/gridfs.cpp b/client/gridfs.cpp index 5c3149f1641..93c907b9a43 100644 --- a/client/gridfs.cpp +++ b/client/gridfs.cpp @@ -94,6 +94,10 @@ namespace mongo { return _client.query( _filesNS.c_str() , emptyObj ); } + auto_ptr GridFS::list( BSONObj o ){ + return _client.query( _filesNS.c_str() , o ); + } + Chunk GridFile::getChunk( int n ){ _exists(); BSONObjBuilder b; diff --git a/client/gridfs.h b/client/gridfs.h index 0f92e45ef25..5e409b9385b 100644 --- a/client/gridfs.h +++ b/client/gridfs.h @@ -74,6 +74,11 @@ namespace mongo { */ auto_ptr list(); + /** + * convenience method to get all the files with a filter + */ + auto_ptr list( BSONObj query ); + private: DBClientBase& _client; string _filesNS;