TurboGears / TurboGears/Ming

MIM: Incorrect positional $ behavior sometimes

Open
#26 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
30
Forks
17
PR merge metrics
No merged PRs in 30d

Description

While working on the fix of #25, I found that sometimes the wrong behavior occurs. On branch mim_dot_dollar_wrong this is illustrated by test_inc_dotted_dollar_middle2 with a $ in the middle of dotted field notation, and selecting for the 2nd subdoc in the list: https://github.com/TurboGears/Ming/blob/256f2b19b389fe5a9ad291f2e8e0359b715ea6af/ming/tests/test_mim.py#L213-L217

AssertionError: {'b': {'f': [{'g': 11}, {'g': 2}]}} != {'b': {'f': [{'g': 1}, {'g': 12}]}}
- {'b': {'f': [{'g': 11}, {'g': 2}]}}
?                    -

+ {'b': {'f': [{'g': 1}, {'g': 12}]}}
?

That branch has expanded tests where the $ is at the end of dotted field notation, and they do all pass.

I haven't looked into this any further, seems kinda tricky. And not actually a blocking problem for me right now.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The failing case is test_inc_dotted_dollar_middle2 in ming/tests/test_mim.py, shown around lines 213-217; start by running that test and compare it with the passing end-of-notation cases on mim_dot_dollar_wrong. Done means the middle-position positional-$ case produces the expected second-subdocument update without regressing those expanded tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
mongodb, python
Domain
databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.