From e20f07a46eeae8d2769604bb2bec09d8e7ddfb4e Mon Sep 17 00:00:00 2001 From: Eliot Horowitz Date: Mon, 2 Feb 2009 22:16:39 -0500 Subject: [PATCH] list takes a filter --- client/gridfs.cpp | 4 ++++ client/gridfs.h | 5 +++++ 2 files changed, 9 insertions(+) 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;