Skip to content

Fix Extended JSON query serialization and shell escaping - #26

Merged
dblock merged 1 commit into
mongoid:masterfrom
dblock:dblock/fix-query-quoting
Oct 15, 2026
Merged

dblock merged 1 commit into
mongoid:masterfrom
dblock:dblock/fix-query-quoting

Conversation

@dblock

@dblock dblock commented Oct 15, 2026

Copy link
Copy Markdown
Collaborator

Summary

Closes #17.

Serialize Hash queries as JSON and shell-escape JSON query arguments for both mongodump and mongoexport. Preserve existing formatting of unrelated command options and password masking.

Add regression tests that execute arguments through a real shell, covering the reported date query, Hashes and symbol keys, compact JSON, quotes, dollar operators, backslashes, newlines, and command-substitution characters. Document supported query inputs.

Validation

  • Full rake suite, including RuboCop.
  • Real mongodump reproduction against MongoDB 7 with Database Tools 100.14.0: both String and Hash inputs succeed and select exactly one of three fixture documents. Temporary database and dumps cleaned up.

@github-actions

github-actions Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Danger Report

No issues found.

View run

@dblock
dblock force-pushed the dblock/fix-query-quoting branch 2 times, most recently from b688eae to e038fbe Compare October 15, 2026 12:08
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@dblock
dblock force-pushed the dblock/fix-query-quoting branch from e038fbe to 4db015a Compare October 15, 2026 12:09
@dblock
dblock merged commit 2473f61 into mongoid:master Oct 15, 2026
11 checks passed
@dblock
dblock deleted the dblock/fix-query-quoting branch October 15, 2026 12:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Failed: error parsing query as Extended JSON: invalid JSON input

1 participant