Skip to content
Snippets Groups Projects
Commit 9d5a6d51 authored by Nelly Barret's avatar Nelly Barret
Browse files

Update api.py

parent 6cc4f766
Branches patch-1
No related tags found
1 merge request!1Update api.py with find_all method
......@@ -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):
"""
......
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