Skip to content

Commit d95f707

Browse files
dongxinEricapkar
authored andcommitted
Resolves #122: Fix the bug where mm emitting wrong doc (#163)
* Added .vscode into gitignore file * Fix the bug where MM returns wrong doc on a certain query.
1 parent b091b95 commit d95f707

3 files changed

Lines changed: 6 additions & 0 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ fdbdoc-trace.*
4141
tags
4242
*~
4343
.idea/*
44+
.vscode/*
4445

4546
smoke_tests/nodejs/node_modules/
4647
smoke_tests/**/target/

test/correctness/mongo_model.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,8 @@ def evaluate(field, query, document, options, debug=False):
133133
if type(query) == dict:
134134
if '$not' in query:
135135
return not evaluate(field, query['$not'], document, options)
136+
elif '$eq' in query:
137+
return evaluate(field, query['$eq'], document, options)
136138
elif '$ne' in query:
137139
return not evaluate(field, query['$ne'], document, options)
138140
elif '$nin' in query:

test/correctness/smoke/test_core.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,9 @@ def test_array13(fixture_collection):
165165
def test_array14(fixture_collection):
166166
run_and_match(fixture_collection, ({'E': [2, 2, []]}, [{'E': {'$ne': []}}]))
167167

168+
def test_array15(fixture_collection):
169+
run_and_match(fixture_collection, ({'E': [2, 2, [1]]}, [{'E': {'$eq': []}}]))
170+
168171

169172
def test_array16(fixture_collection):
170173
run_and_match(fixture_collection, ({'E': [2, 2, [1]]}, [{'E': [1]}]))

0 commit comments

Comments
 (0)