From e3ef5ed7b17a63dcd1fbf56b2b7f48a890d85e7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=B5=90=E6=84=9B=E3=81=99=E3=81=BF=E3=81=8B?= Date: Sat, 20 Apr 2024 22:27:07 -0400 Subject: [PATCH] bug fixes --- mongodb/source/autograder.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mongodb/source/autograder.py b/mongodb/source/autograder.py index 9382760..932b0ea 100644 --- a/mongodb/source/autograder.py +++ b/mongodb/source/autograder.py @@ -82,7 +82,7 @@ def evaluate(query : str): return tuple(evaluate(q) for q in query) query = re.sub(r'//[^\n]*', '', query) query = re.sub(r'(\$?[\d\w_]+)[\s\r\n]*:', r'"\1" :', query) - query = re.sub(r'[\r\n]|.\s*pretty\s*\(\s*\)|.\s*sort\s*\([^\)]*\)', '', query).strip() + query = re.sub(r'[\r\n]|.\s*(pretty|toArray)\s*\(\s*\)|.\s*sort\s*\([^\)]*\)', '', query).strip() if not query: return [None] * 2 query = re.sub(r'.\s*aggregate\s*\(\s*([^\[^\s][^\)]*)\)', r'.aggregate([\1])', query)