diff --git a/mongiris/api.py b/mongiris/api.py index d2c0ffd40f3625d649578bfcd73ee8f72ece8ada..cfc70b8792819b5dc0ddca1304131589bf0d1428 100755 --- a/mongiris/api.py +++ b/mongiris/api.py @@ -133,6 +133,20 @@ class Mongiris: doc = collection.find_one(json_query) doc_json = Mongiris.bson_to_json(doc) return doc_json + + def find_all(self, collection): + """ + Finds all documents in the given collection. + + Args: + collection: a string representing the collection name + + Returns: + doc_json: a dictionnary representing the documents, or None + """ + doc = collection.find() + doc_json = Mongiris.bson_to_json(doc) + return doc_json def find_all(self, collection): """