Skip to content
Snippets Groups Projects

Update api.py with find_all method

Merged Nelly Barret requested to merge patch-1 into master
1 file
+ 14
0
Compare changes
  • Side-by-side
  • Inline
+ 14
0
@@ -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):
"""
"""
Loading