fix(mongodb): keep plain strings when batch pasting values

This commit is contained in:
jearhe authored and GitHub committed 2026-09-03 17:51:34 +08:00
1 parent 3a52fd2a0b
commit 20f312d650
3 files changed
+93 -4

No files matched your search

+7
View File
@@ -61,6 +61,13 @@ test("preserves date-shaped Mongo strings instead of guessing Date", () => {
assert.equal(parseMongoDocumentInputValue('"2025-08-14 02:25:43.718"'), "2025-08-14 02:25:43.718");
});
test("preserves plain text that only resembles Mongo JSON input", () => {
for (const value of ["{plain text", "[plain text", '"plain text']) {
assert.doesNotThrow(() => parseMongoDocumentInputValue(value));
assert.equal(parseMongoDocumentInputValue(value), value);
}
});
test("preserves existing date-shaped Mongo string fields on grid update", () => {
const original = {
_id: "1",