Skip to content

fix(linux-mongodb): keep NULL apart from a missing field, export number fields as numbers, write mongosh constructors - #4208

Merged
datlechin merged 3 commits into
mainfrom
fix/linux-mongodb-3646-review
Nov 11, 2026
Merged

datlechin merged 3 commits into
mainfrom
fix/linux-mongodb-3646-review

Conversation

@datlechin

@datlechin datlechin commented Nov 11, 2026 •

Copy link
Copy Markdown
Member

Summary

Follow-up to #4202, from a full review of it.

  • NULL and a missing field are kept apart: a document field's default is $$REMOVE, so an untouched new-row cell is left out; NULL typed in the grid writes null (validators that require a nullable field pass); Set to Default on a saved row is $unset. A NULL the app read (Duplicate Rows, a paste, a CSV import's null marker) is left out, since a page reads a missing field as NULL (SqlDialect::reads_missing_as_null, edit::read_cell).
  • A field of more than one numeric type has its own type, document::NUMBER_TYPE: row exports (CSV, TSV, XLSX, JSON, HTML, XML, Markdown, text) write its values as numbers, doubles as doubles and other fractions exactly; other engines' JSON columns are unchanged. Its filter offers comparisons only.
  • Statements and Copy As write Extended JSON as mongosh constructors (NumberLong, NumberDecimal, Double, ISODate, ObjectId, UUID, BinData, Timestamp, BSONRegExp, MinKey, MaxKey), which TablePro's parser and the driver read back to the same BSON.
  • Table export: the census drops sorts that do not decide which documents pass, the read ends with a $project of the census fields (a field added mid-export no longer fails it), and columns keep the tab's order.
  • Safe Mode Off asks before a $merge into the collection being aggregated.
  • Catalogue reads check the stop before each command and batch, as cursor reads do.
  • Docs: mongodb.md, adding-drivers.md, testing.md (public DNS and port 27017 for the seed-list tests).
  • Tests from fix(linux-mongodb): seed-list login, field-safe writes and exports, UUID columns, drops that ask, stops on Atlas free tier #4202 that read an int32 _id as Value::Int now expect Value::Int32, which fix(core): bound result bytes, keep MongoDB number types, hold FFI secrets in secrecy, keep long iOS query values whole and give each iOS connection one session owner #4201 made the cell type (seed_list, replica_set, stop, export, session_mongodb); they fail on main.
  • Tests changed on purpose: field_types (int and long is number), a_field_of_ints_and_doubles_keeps_the_comparisons (no Contains), shell_literal cases (Double(2), BSONRegExp), document::tests NULL cases ($set: null, Default is $unset), export/sql.rs back to its pre-fix(linux-mongodb): seed-list login, field-safe writes and exports, UUID columns, drops that ask, stops on Atlas free tier #4202 tests.

Test plan

  • MongoDB Docker suite on macOS: 79 of 81 pass, with new cases for a number field's export, an imported NULL under a sparse unique index, a field added mid-export, and export column order. The two tls::forwarded::* failures happen on main too on macOS.
  • Unit tests of core, the driver and mcp (1248); clippy with and without default features; rustfmt.
  • The app crate (row_edits.rs, paste.rs, tracked_values.rs, data_grid/mod.rs) does not build on macOS: CI's Linux jobs.

Refs #3646

@datlechin
datlechin merged commit e2dd236 into main Nov 11, 2026
32 of 34 checks passed
@datlechin
datlechin deleted the fix/linux-mongodb-3646-review branch November 11, 2026 18:52
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.

1 participant