Skip to content
Snippets Groups Projects
Commit fbe32eed authored by Duchateau Fabien's avatar Duchateau Fabien
Browse files

Merge branch 'patch-1' into 'master'

Update api.py with find_all method

See merge request !1
parents 6cc4f766 9d5a6d51
No related branches found
No related tags found
1 merge request!1Update api.py with find_all method
...@@ -131,6 +131,20 @@ class Mongiris: ...@@ -131,6 +131,20 @@ class Mongiris:
doc = collection.find_one(json_query) doc = collection.find_one(json_query)
doc_json = Mongiris.bson_to_json(doc) doc_json = Mongiris.bson_to_json(doc)
return doc_json 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): def get_iris_from_code(self, code_iris):
""" """
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment