Commit fbe32eed authored by Duchateau Fabien's avatar Duchateau Fabien

Merge branch 'patch-1' into 'master'

Update api.py with find_all method

See merge request !1
parents 6cc4f766 9d5a6d51
......@@ -131,6 +131,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 get_iris_from_code(self, code_iris):
"""
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment