Commit bcab586
fix: Use ISO-8601 date format in MongoDB to BigQuery template
MongoDB ISODate fields were being serialized using the JVM's default
locale, resulting in descriptive date formats like "Feb 3, 2026, 3:31:41 PM"
instead of ISO-8601 format.
This change configures MongoDB's JsonWriterSettings to use JsonMode.RELAXED,
which outputs dates in ISO-8601 format: {"$date": "2026-02-03T15:31:41.924Z"}.
Changes:
- Added EXTENDED_JSON_WRITER_SETTINGS constant to MongoDbUtils
- Updated getTableSchema() to use MongoDB JsonWriterSettings for all user
options (FLATTEN, JSON, NONE)
- Updated JavascriptDocumentTransformer to use consistent date serialization
- Added unit tests to verify ISO-8601 date format
- Updated integration test for consistency
Fixes locale-dependent date serialization issues in BigQuery output.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>1 parent ea80a3b commit bcab586
File tree
4 files changed
+88
-6
lines changed- v2/mongodb-to-googlecloud/src
- main/java/com/google/cloud/teleport/v2
- mongodb/templates
- transforms
- test/java/com/google/cloud/teleport/v2/mongodb/templates
4 files changed
+88
-6
lines changedLines changed: 28 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
| 57 | + | |
| 58 | + | |
57 | 59 | | |
58 | 60 | | |
59 | 61 | | |
| |||
73 | 75 | | |
74 | 76 | | |
75 | 77 | | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
76 | 85 | | |
77 | 86 | | |
78 | 87 | | |
| |||
141 | 150 | | |
142 | 151 | | |
143 | 152 | | |
144 | | - | |
| 153 | + | |
145 | 154 | | |
146 | 155 | | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
147 | 169 | | |
148 | 170 | | |
149 | 171 | | |
150 | 172 | | |
151 | 173 | | |
152 | 174 | | |
153 | | - | |
| 175 | + | |
| 176 | + | |
154 | 177 | | |
155 | 178 | | |
156 | 179 | | |
| |||
160 | 183 | | |
161 | 184 | | |
162 | 185 | | |
163 | | - | |
| 186 | + | |
164 | 187 | | |
165 | 188 | | |
166 | 189 | | |
| |||
188 | 211 | | |
189 | 212 | | |
190 | 213 | | |
191 | | - | |
| 214 | + | |
| 215 | + | |
192 | 216 | | |
193 | 217 | | |
194 | 218 | | |
| |||
Lines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
| |||
147 | 148 | | |
148 | 149 | | |
149 | 150 | | |
150 | | - | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
151 | 154 | | |
152 | 155 | | |
153 | 156 | | |
| |||
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
215 | 215 | | |
216 | 216 | | |
217 | 217 | | |
218 | | - | |
| 218 | + | |
| 219 | + | |
219 | 220 | | |
220 | 221 | | |
221 | 222 | | |
| |||
Lines changed: 54 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
| 19 | + | |
18 | 20 | | |
19 | 21 | | |
20 | 22 | | |
21 | 23 | | |
| 24 | + | |
22 | 25 | | |
23 | 26 | | |
24 | 27 | | |
| |||
69 | 72 | | |
70 | 73 | | |
71 | 74 | | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
72 | 126 | | |
0 commit comments