This is an automated email from the ASF dual-hosted git repository.
mattcasters pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/hop.git
The following commit(s) were added to refs/heads/main by this push:
new 92ccbe9d02 issue #7183 : fix MongoDB Output ObjectId match after BSON
5.x (#7495)
92ccbe9d02 is described below
commit 92ccbe9d023c54ea66d45f2be82910653628b6ca
Author: Matt Casters <[email protected]>
AuthorDate: Sun Jul 12 16:49:54 2026 +0200
issue #7183 : fix MongoDB Output ObjectId match after BSON 5.x (#7495)
Parse JSON field values via a wrapper document so extended JSON
ObjectIds ({"$oid":"..."}) decode correctly for update match fields.
Add unit coverage and a mongo integration suite that updates by _id.
---
.../main-mongo-atlas-objectid-update.hwf | 163 +++++++++++++
.../main-mongo-objectid-update.hwf | 163 +++++++++++++
.../mongo-insert-objectid.hpl | 123 ++++++++++
.../mongo-update-objectid-match.hpl | 163 +++++++++++++
.../mongo-validate-objectid-update.hpl | 262 +++++++++++++++++++++
.../mongodboutput/MongoDbOutputData.java | 2 +
.../mongodboutput/MongoDbOutputDataTest.java | 1 +
7 files changed, 877 insertions(+)
diff --git
a/integration-tests/mongo/tests/mongo-objectid-update/main-mongo-atlas-objectid-update.hwf
b/integration-tests/mongo/tests/mongo-objectid-update/main-mongo-atlas-objectid-update.hwf
new file mode 100644
index 0000000000..238d815fb3
--- /dev/null
+++
b/integration-tests/mongo/tests/mongo-objectid-update/main-mongo-atlas-objectid-update.hwf
@@ -0,0 +1,163 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements. See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+
+-->
+<workflow>
+ <name>main-mongo-atlas-objectid-update</name>
+ <name_sync_with_filename>Y</name_sync_with_filename>
+ <description>Insert, update-by-ObjectId (#7183), and validate against
MongoDB Atlas local</description>
+ <extended_description/>
+ <workflow_version/>
+ <workflow_status>0</workflow_status>
+ <created_user>-</created_user>
+ <created_date>2026/07/11 12:00:00.000</created_date>
+ <modified_user>-</modified_user>
+ <modified_date>2026/07/11 12:00:00.000</modified_date>
+ <parameters>
+ <parameter>
+ <name>MONGO_CONNECTION</name>
+ <default_value>mongo-atlas</default_value>
+ <description/>
+ </parameter>
+ </parameters>
+ <actions>
+ <action>
+ <name>Start</name>
+ <description/>
+ <type>SPECIAL</type>
+ <attributes/>
+ <DayOfMonth>1</DayOfMonth>
+ <doNotWaitOnFirstExecution>N</doNotWaitOnFirstExecution>
+ <hour>12</hour>
+ <intervalMinutes>60</intervalMinutes>
+ <intervalSeconds>0</intervalSeconds>
+ <minutes>0</minutes>
+ <repeat>N</repeat>
+ <schedulerType>0</schedulerType>
+ <weekDay>1</weekDay>
+ <parallel>N</parallel>
+ <xloc>50</xloc>
+ <yloc>50</yloc>
+ <attributes_hac/>
+ </action>
+ <action>
+ <name>mongo-insert-objectid.hpl</name>
+ <description/>
+ <type>PIPELINE</type>
+ <attributes/>
+ <add_date>N</add_date>
+ <add_time>N</add_time>
+ <clear_files>N</clear_files>
+ <clear_rows>N</clear_rows>
+ <create_parent_folder>N</create_parent_folder>
+ <exec_per_row>N</exec_per_row>
+
<filename>${PROJECT_HOME}/tests/mongo-objectid-update/mongo-insert-objectid.hpl</filename>
+ <loglevel>Basic</loglevel>
+ <parameters>
+ <pass_all_parameters>Y</pass_all_parameters>
+ </parameters>
+ <params_from_previous>N</params_from_previous>
+ <run_configuration>local</run_configuration>
+ <set_append_logfile>N</set_append_logfile>
+ <set_logfile>N</set_logfile>
+ <wait_until_finished>Y</wait_until_finished>
+ <parallel>N</parallel>
+ <xloc>240</xloc>
+ <yloc>48</yloc>
+ <attributes_hac/>
+ </action>
+ <action>
+ <name>mongo-update-objectid-match.hpl</name>
+ <description/>
+ <type>PIPELINE</type>
+ <attributes/>
+ <add_date>N</add_date>
+ <add_time>N</add_time>
+ <clear_files>N</clear_files>
+ <clear_rows>N</clear_rows>
+ <create_parent_folder>N</create_parent_folder>
+ <exec_per_row>N</exec_per_row>
+
<filename>${PROJECT_HOME}/tests/mongo-objectid-update/mongo-update-objectid-match.hpl</filename>
+ <loglevel>Basic</loglevel>
+ <parameters>
+ <pass_all_parameters>Y</pass_all_parameters>
+ </parameters>
+ <params_from_previous>N</params_from_previous>
+ <run_configuration>local</run_configuration>
+ <set_append_logfile>N</set_append_logfile>
+ <set_logfile>N</set_logfile>
+ <wait_until_finished>Y</wait_until_finished>
+ <parallel>N</parallel>
+ <xloc>464</xloc>
+ <yloc>48</yloc>
+ <attributes_hac/>
+ </action>
+ <action>
+ <name>mongo-validate-objectid-update.hpl</name>
+ <description/>
+ <type>PIPELINE</type>
+ <attributes/>
+ <add_date>N</add_date>
+ <add_time>N</add_time>
+ <clear_files>N</clear_files>
+ <clear_rows>N</clear_rows>
+ <create_parent_folder>N</create_parent_folder>
+ <exec_per_row>N</exec_per_row>
+
<filename>${PROJECT_HOME}/tests/mongo-objectid-update/mongo-validate-objectid-update.hpl</filename>
+ <loglevel>Basic</loglevel>
+ <parameters>
+ <pass_all_parameters>Y</pass_all_parameters>
+ </parameters>
+ <params_from_previous>N</params_from_previous>
+ <run_configuration>local</run_configuration>
+ <set_append_logfile>N</set_append_logfile>
+ <set_logfile>N</set_logfile>
+ <wait_until_finished>Y</wait_until_finished>
+ <parallel>N</parallel>
+ <xloc>720</xloc>
+ <yloc>48</yloc>
+ <attributes_hac/>
+ </action>
+ </actions>
+ <hops>
+ <hop>
+ <from>Start</from>
+ <to>mongo-insert-objectid.hpl</to>
+ <enabled>Y</enabled>
+ <evaluation>Y</evaluation>
+ <unconditional>Y</unconditional>
+ </hop>
+ <hop>
+ <from>mongo-insert-objectid.hpl</from>
+ <to>mongo-update-objectid-match.hpl</to>
+ <enabled>Y</enabled>
+ <evaluation>Y</evaluation>
+ <unconditional>N</unconditional>
+ </hop>
+ <hop>
+ <from>mongo-update-objectid-match.hpl</from>
+ <to>mongo-validate-objectid-update.hpl</to>
+ <enabled>Y</enabled>
+ <evaluation>Y</evaluation>
+ <unconditional>N</unconditional>
+ </hop>
+ </hops>
+ <notepads>
+ </notepads>
+ <attributes/>
+</workflow>
diff --git
a/integration-tests/mongo/tests/mongo-objectid-update/main-mongo-objectid-update.hwf
b/integration-tests/mongo/tests/mongo-objectid-update/main-mongo-objectid-update.hwf
new file mode 100644
index 0000000000..aaf446222d
--- /dev/null
+++
b/integration-tests/mongo/tests/mongo-objectid-update/main-mongo-objectid-update.hwf
@@ -0,0 +1,163 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements. See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+
+-->
+<workflow>
+ <name>main-mongo-objectid-update</name>
+ <name_sync_with_filename>Y</name_sync_with_filename>
+ <description>Insert, update-by-ObjectId (#7183), and validate against
MongoDB</description>
+ <extended_description/>
+ <workflow_version/>
+ <workflow_status>0</workflow_status>
+ <created_user>-</created_user>
+ <created_date>2026/07/11 12:00:00.000</created_date>
+ <modified_user>-</modified_user>
+ <modified_date>2026/07/11 12:00:00.000</modified_date>
+ <parameters>
+ <parameter>
+ <name>MONGO_CONNECTION</name>
+ <default_value>mongo</default_value>
+ <description/>
+ </parameter>
+ </parameters>
+ <actions>
+ <action>
+ <name>Start</name>
+ <description/>
+ <type>SPECIAL</type>
+ <attributes/>
+ <DayOfMonth>1</DayOfMonth>
+ <doNotWaitOnFirstExecution>N</doNotWaitOnFirstExecution>
+ <hour>12</hour>
+ <intervalMinutes>60</intervalMinutes>
+ <intervalSeconds>0</intervalSeconds>
+ <minutes>0</minutes>
+ <repeat>N</repeat>
+ <schedulerType>0</schedulerType>
+ <weekDay>1</weekDay>
+ <parallel>N</parallel>
+ <xloc>50</xloc>
+ <yloc>50</yloc>
+ <attributes_hac/>
+ </action>
+ <action>
+ <name>mongo-insert-objectid.hpl</name>
+ <description/>
+ <type>PIPELINE</type>
+ <attributes/>
+ <add_date>N</add_date>
+ <add_time>N</add_time>
+ <clear_files>N</clear_files>
+ <clear_rows>N</clear_rows>
+ <create_parent_folder>N</create_parent_folder>
+ <exec_per_row>N</exec_per_row>
+
<filename>${PROJECT_HOME}/tests/mongo-objectid-update/mongo-insert-objectid.hpl</filename>
+ <loglevel>Basic</loglevel>
+ <parameters>
+ <pass_all_parameters>Y</pass_all_parameters>
+ </parameters>
+ <params_from_previous>N</params_from_previous>
+ <run_configuration>local</run_configuration>
+ <set_append_logfile>N</set_append_logfile>
+ <set_logfile>N</set_logfile>
+ <wait_until_finished>Y</wait_until_finished>
+ <parallel>N</parallel>
+ <xloc>240</xloc>
+ <yloc>48</yloc>
+ <attributes_hac/>
+ </action>
+ <action>
+ <name>mongo-update-objectid-match.hpl</name>
+ <description/>
+ <type>PIPELINE</type>
+ <attributes/>
+ <add_date>N</add_date>
+ <add_time>N</add_time>
+ <clear_files>N</clear_files>
+ <clear_rows>N</clear_rows>
+ <create_parent_folder>N</create_parent_folder>
+ <exec_per_row>N</exec_per_row>
+
<filename>${PROJECT_HOME}/tests/mongo-objectid-update/mongo-update-objectid-match.hpl</filename>
+ <loglevel>Basic</loglevel>
+ <parameters>
+ <pass_all_parameters>Y</pass_all_parameters>
+ </parameters>
+ <params_from_previous>N</params_from_previous>
+ <run_configuration>local</run_configuration>
+ <set_append_logfile>N</set_append_logfile>
+ <set_logfile>N</set_logfile>
+ <wait_until_finished>Y</wait_until_finished>
+ <parallel>N</parallel>
+ <xloc>464</xloc>
+ <yloc>48</yloc>
+ <attributes_hac/>
+ </action>
+ <action>
+ <name>mongo-validate-objectid-update.hpl</name>
+ <description/>
+ <type>PIPELINE</type>
+ <attributes/>
+ <add_date>N</add_date>
+ <add_time>N</add_time>
+ <clear_files>N</clear_files>
+ <clear_rows>N</clear_rows>
+ <create_parent_folder>N</create_parent_folder>
+ <exec_per_row>N</exec_per_row>
+
<filename>${PROJECT_HOME}/tests/mongo-objectid-update/mongo-validate-objectid-update.hpl</filename>
+ <loglevel>Basic</loglevel>
+ <parameters>
+ <pass_all_parameters>Y</pass_all_parameters>
+ </parameters>
+ <params_from_previous>N</params_from_previous>
+ <run_configuration>local</run_configuration>
+ <set_append_logfile>N</set_append_logfile>
+ <set_logfile>N</set_logfile>
+ <wait_until_finished>Y</wait_until_finished>
+ <parallel>N</parallel>
+ <xloc>720</xloc>
+ <yloc>48</yloc>
+ <attributes_hac/>
+ </action>
+ </actions>
+ <hops>
+ <hop>
+ <from>Start</from>
+ <to>mongo-insert-objectid.hpl</to>
+ <enabled>Y</enabled>
+ <evaluation>Y</evaluation>
+ <unconditional>Y</unconditional>
+ </hop>
+ <hop>
+ <from>mongo-insert-objectid.hpl</from>
+ <to>mongo-update-objectid-match.hpl</to>
+ <enabled>Y</enabled>
+ <evaluation>Y</evaluation>
+ <unconditional>N</unconditional>
+ </hop>
+ <hop>
+ <from>mongo-update-objectid-match.hpl</from>
+ <to>mongo-validate-objectid-update.hpl</to>
+ <enabled>Y</enabled>
+ <evaluation>Y</evaluation>
+ <unconditional>N</unconditional>
+ </hop>
+ </hops>
+ <notepads>
+ </notepads>
+ <attributes/>
+</workflow>
diff --git
a/integration-tests/mongo/tests/mongo-objectid-update/mongo-insert-objectid.hpl
b/integration-tests/mongo/tests/mongo-objectid-update/mongo-insert-objectid.hpl
new file mode 100644
index 0000000000..991f8ff439
--- /dev/null
+++
b/integration-tests/mongo/tests/mongo-objectid-update/mongo-insert-objectid.hpl
@@ -0,0 +1,123 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements. See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+
+-->
+<pipeline>
+ <info>
+ <name>mongo-insert-objectid</name>
+ <name_sync_with_filename>Y</name_sync_with_filename>
+ <description>Seed documents with fixed ObjectId _id values for issue
#7183</description>
+ <extended_description/>
+ <pipeline_version/>
+ <pipeline_type>Normal</pipeline_type>
+ <parameters>
+ </parameters>
+ <capture_transform_performance>N</capture_transform_performance>
+
<transform_performance_capturing_delay>1000</transform_performance_capturing_delay>
+
<transform_performance_capturing_size_limit>100</transform_performance_capturing_size_limit>
+ <created_user>-</created_user>
+ <created_date>2026/07/11 12:00:00.000</created_date>
+ <modified_user>-</modified_user>
+ <modified_date>2026/07/11 12:00:00.000</modified_date>
+ </info>
+ <notepads>
+ </notepads>
+ <order>
+ <hop>
+ <from>Data grid</from>
+ <to>insert</to>
+ <enabled>Y</enabled>
+ </hop>
+ </order>
+ <transform>
+ <name>Data grid</name>
+ <type>DataGrid</type>
+ <description/>
+ <distribute>Y</distribute>
+ <custom_distribution/>
+ <copies>1</copies>
+ <partitioning>
+ <method>none</method>
+ <schema_name/>
+ </partitioning>
+ <data>
+ <line>
+ <item>{"_id": {"$oid": "6a15efdd0a93aa5ed3b4b947"}, "name": "alice",
"status": "old"}</item>
+ </line>
+ <line>
+ <item>{"_id": {"$oid": "6a15efdd0a93aa5ed3b4b948"}, "name": "bob",
"status": "old"}</item>
+ </line>
+ </data>
+ <fields>
+ <field>
+ <length>-1</length>
+ <precision>-1</precision>
+ <set_empty_string>N</set_empty_string>
+ <name>doc</name>
+ <type>String</type>
+ </field>
+ </fields>
+ <attributes/>
+ <GUI>
+ <xloc>224</xloc>
+ <yloc>128</yloc>
+ </GUI>
+ </transform>
+ <transform>
+ <name>insert</name>
+ <type>MongoDbOutput</type>
+ <description/>
+ <distribute>Y</distribute>
+ <custom_distribution/>
+ <copies>1</copies>
+ <partitioning>
+ <method>none</method>
+ <schema_name/>
+ </partitioning>
+ <connection>${MONGO_CONNECTION}</connection>
+ <mongo_collection>m_objectid_updates</mongo_collection>
+ <batch_insert_size>5</batch_insert_size>
+ <truncate>Y</truncate>
+ <update>N</update>
+ <upsert>N</upsert>
+ <multi>N</multi>
+ <modifier_update>N</modifier_update>
+ <write_retries>5</write_retries>
+ <write_retry_delay>10</write_retry_delay>
+ <mongo_fields>
+ <mongo_field>
+ <incoming_field_name>doc</incoming_field_name>
+ <mongo_doc_path/>
+
<use_incoming_field_name_as_mongo_field_name>N</use_incoming_field_name_as_mongo_field_name>
+ <update_match_field>N</update_match_field>
+ <modifier_update_operation>N/A</modifier_update_operation>
+ <modifier_policy>Insert&Update</modifier_policy>
+ <json_field>Y</json_field>
+ <allow_null>N</allow_null>
+ </mongo_field>
+ </mongo_fields>
+ <attributes/>
+ <GUI>
+ <xloc>416</xloc>
+ <yloc>128</yloc>
+ </GUI>
+ </transform>
+ <transform_error_handling>
+ </transform_error_handling>
+ <attributes/>
+</pipeline>
diff --git
a/integration-tests/mongo/tests/mongo-objectid-update/mongo-update-objectid-match.hpl
b/integration-tests/mongo/tests/mongo-objectid-update/mongo-update-objectid-match.hpl
new file mode 100644
index 0000000000..b57ffc95f0
--- /dev/null
+++
b/integration-tests/mongo/tests/mongo-objectid-update/mongo-update-objectid-match.hpl
@@ -0,0 +1,163 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements. See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+
+-->
+<pipeline>
+ <info>
+ <name>mongo-update-objectid-match</name>
+ <name_sync_with_filename>Y</name_sync_with_filename>
+ <description>Reproduce #7183: update match on ObjectId _id with
json_field=Y (extended JSON $oid)</description>
+ <extended_description/>
+ <pipeline_version/>
+ <pipeline_type>Normal</pipeline_type>
+ <parameters>
+ </parameters>
+ <capture_transform_performance>N</capture_transform_performance>
+
<transform_performance_capturing_delay>1000</transform_performance_capturing_delay>
+
<transform_performance_capturing_size_limit>100</transform_performance_capturing_size_limit>
+ <created_user>-</created_user>
+ <created_date>2026/07/11 12:00:00.000</created_date>
+ <modified_user>-</modified_user>
+ <modified_date>2026/07/11 12:00:00.000</modified_date>
+ </info>
+ <notepads>
+ <notepad>
+ <backgroundcolorblue>251</backgroundcolorblue>
+ <backgroundcolorgreen>232</backgroundcolorgreen>
+ <backgroundcolorred>201</backgroundcolorred>
+ <bordercolorblue>90</bordercolorblue>
+ <bordercolorgreen>58</bordercolorgreen>
+ <bordercolorred>14</bordercolorred>
+ <fontbold>N</fontbold>
+ <fontcolorblue>90</fontcolorblue>
+ <fontcolorgreen>58</fontcolorgreen>
+ <fontcolorred>14</fontcolorred>
+ <fontitalic>N</fontitalic>
+ <fontname>Sans</fontname>
+ <fontsize>9</fontsize>
+ <height>56</height>
+ <xloc>96</xloc>
+ <yloc>32</yloc>
+ <note>Issue #7183: bson 5.x Document.parse fails on top-level
{"$oid":"..."}
+when json_field=Y is used for ObjectId match fields.</note>
+ <width>480</width>
+ </notepad>
+ </notepads>
+ <order>
+ <hop>
+ <from>Data grid</from>
+ <to>update by ObjectId</to>
+ <enabled>Y</enabled>
+ </hop>
+ </order>
+ <transform>
+ <name>Data grid</name>
+ <type>DataGrid</type>
+ <description/>
+ <distribute>Y</distribute>
+ <custom_distribution/>
+ <copies>1</copies>
+ <partitioning>
+ <method>none</method>
+ <schema_name/>
+ </partitioning>
+ <data>
+ <line>
+ <item>{"$oid": "6a15efdd0a93aa5ed3b4b947"}</item>
+ <item>new</item>
+ </line>
+ <line>
+ <item>{"$oid": "6a15efdd0a93aa5ed3b4b948"}</item>
+ <item>new</item>
+ </line>
+ </data>
+ <fields>
+ <field>
+ <length>-1</length>
+ <precision>-1</precision>
+ <set_empty_string>N</set_empty_string>
+ <name>_id</name>
+ <type>String</type>
+ </field>
+ <field>
+ <length>-1</length>
+ <precision>-1</precision>
+ <set_empty_string>N</set_empty_string>
+ <name>status</name>
+ <type>String</type>
+ </field>
+ </fields>
+ <attributes/>
+ <GUI>
+ <xloc>160</xloc>
+ <yloc>160</yloc>
+ </GUI>
+ </transform>
+ <transform>
+ <name>update by ObjectId</name>
+ <type>MongoDbOutput</type>
+ <description/>
+ <distribute>Y</distribute>
+ <custom_distribution/>
+ <copies>1</copies>
+ <partitioning>
+ <method>none</method>
+ <schema_name/>
+ </partitioning>
+ <connection>${MONGO_CONNECTION}</connection>
+ <mongo_collection>m_objectid_updates</mongo_collection>
+ <batch_insert_size>5</batch_insert_size>
+ <truncate>N</truncate>
+ <update>Y</update>
+ <upsert>N</upsert>
+ <multi>N</multi>
+ <modifier_update>Y</modifier_update>
+ <write_retries>5</write_retries>
+ <write_retry_delay>10</write_retry_delay>
+ <mongo_fields>
+ <mongo_field>
+ <incoming_field_name>_id</incoming_field_name>
+ <mongo_doc_path/>
+
<use_incoming_field_name_as_mongo_field_name>Y</use_incoming_field_name_as_mongo_field_name>
+ <update_match_field>Y</update_match_field>
+ <modifier_update_operation>N/A</modifier_update_operation>
+ <modifier_policy>Insert</modifier_policy>
+ <json_field>Y</json_field>
+ <allow_null>N</allow_null>
+ </mongo_field>
+ <mongo_field>
+ <incoming_field_name>status</incoming_field_name>
+ <mongo_doc_path/>
+
<use_incoming_field_name_as_mongo_field_name>Y</use_incoming_field_name_as_mongo_field_name>
+ <update_match_field>N</update_match_field>
+ <modifier_update_operation>$set</modifier_update_operation>
+ <modifier_policy>Insert&Update</modifier_policy>
+ <json_field>N</json_field>
+ <allow_null>N</allow_null>
+ </mongo_field>
+ </mongo_fields>
+ <attributes/>
+ <GUI>
+ <xloc>400</xloc>
+ <yloc>160</yloc>
+ </GUI>
+ </transform>
+ <transform_error_handling>
+ </transform_error_handling>
+ <attributes/>
+</pipeline>
diff --git
a/integration-tests/mongo/tests/mongo-objectid-update/mongo-validate-objectid-update.hpl
b/integration-tests/mongo/tests/mongo-objectid-update/mongo-validate-objectid-update.hpl
new file mode 100644
index 0000000000..c478024630
--- /dev/null
+++
b/integration-tests/mongo/tests/mongo-objectid-update/mongo-validate-objectid-update.hpl
@@ -0,0 +1,262 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements. See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+
+-->
+<pipeline>
+ <info>
+ <name>mongo-validate-objectid-update</name>
+ <name_sync_with_filename>Y</name_sync_with_filename>
+ <description>Assert ObjectId-matched updates applied (status=new for both
docs)</description>
+ <extended_description/>
+ <pipeline_version/>
+ <pipeline_type>Normal</pipeline_type>
+ <parameters>
+ </parameters>
+ <capture_transform_performance>N</capture_transform_performance>
+
<transform_performance_capturing_delay>1000</transform_performance_capturing_delay>
+
<transform_performance_capturing_size_limit>100</transform_performance_capturing_size_limit>
+ <created_user>-</created_user>
+ <created_date>2026/07/11 12:00:00.000</created_date>
+ <modified_user>-</modified_user>
+ <modified_date>2026/07/11 12:00:00.000</modified_date>
+ </info>
+ <notepads>
+ <notepad>
+ <backgroundcolorblue>251</backgroundcolorblue>
+ <backgroundcolorgreen>232</backgroundcolorgreen>
+ <backgroundcolorred>201</backgroundcolorred>
+ <bordercolorblue>90</bordercolorblue>
+ <bordercolorgreen>58</bordercolorgreen>
+ <bordercolorred>14</bordercolorred>
+ <fontbold>N</fontbold>
+ <fontcolorblue>90</fontcolorblue>
+ <fontcolorgreen>58</fontcolorgreen>
+ <fontcolorred>14</fontcolorred>
+ <fontitalic>N</fontitalic>
+ <fontname>Sans</fontname>
+ <fontsize>9</fontsize>
+ <height>48</height>
+ <xloc>128</xloc>
+ <yloc>32</yloc>
+ <note>After ObjectId match update both docs must have status=new.
+If match failed silently, status would still be old.</note>
+ <width>420</width>
+ </notepad>
+ </notepads>
+ <order>
+ <hop>
+ <from>MongoDB input</from>
+ <to>Data validator</to>
+ <enabled>Y</enabled>
+ </hop>
+ <hop>
+ <from>MongoDB input</from>
+ <to>Group by</to>
+ <enabled>Y</enabled>
+ </hop>
+ <hop>
+ <from>Group by</from>
+ <to>Filter rows</to>
+ <enabled>Y</enabled>
+ </hop>
+ <hop>
+ <from>Filter rows</from>
+ <to>Abort</to>
+ <enabled>Y</enabled>
+ </hop>
+ </order>
+ <transform>
+ <name>Abort</name>
+ <type>Abort</type>
+ <description/>
+ <distribute>Y</distribute>
+ <custom_distribution/>
+ <copies>1</copies>
+ <partitioning>
+ <method>none</method>
+ <schema_name/>
+ </partitioning>
+ <abort_option>ABORT_WITH_ERROR</abort_option>
+ <always_log_rows>Y</always_log_rows>
+ <row_threshold>0</row_threshold>
+ <attributes/>
+ <GUI>
+ <xloc>720</xloc>
+ <yloc>240</yloc>
+ </GUI>
+ </transform>
+ <transform>
+ <name>Data validator</name>
+ <type>Validator</type>
+ <description/>
+ <distribute>Y</distribute>
+ <custom_distribution/>
+ <copies>1</copies>
+ <partitioning>
+ <method>none</method>
+ <schema_name/>
+ </partitioning>
+ <concat_errors>N</concat_errors>
+ <validate_all>N</validate_all>
+ <validator_field>
+ <allowed_value>
+ <value>new</value>
+ </allowed_value>
+ <data_type>String</data_type>
+ <data_type_verified>N</data_type_verified>
+ <is_sourcing_values>N</is_sourcing_values>
+ <max_length/>
+ <min_length/>
+ <name>status</name>
+ <null_allowed>N</null_allowed>
+ <only_null_allowed>N</only_null_allowed>
+ <only_numeric_allowed>N</only_numeric_allowed>
+ <validation_name>status_is_new</validation_name>
+ </validator_field>
+ <validator_field>
+ <allowed_value>
+ <value>alice</value>
+ <value>bob</value>
+ </allowed_value>
+ <data_type>String</data_type>
+ <data_type_verified>N</data_type_verified>
+ <is_sourcing_values>N</is_sourcing_values>
+ <max_length/>
+ <min_length/>
+ <name>name</name>
+ <null_allowed>N</null_allowed>
+ <only_null_allowed>N</only_null_allowed>
+ <only_numeric_allowed>N</only_numeric_allowed>
+ <validation_name>name_is_alice_or_bob</validation_name>
+ </validator_field>
+ <attributes/>
+ <GUI>
+ <xloc>400</xloc>
+ <yloc>144</yloc>
+ </GUI>
+ </transform>
+ <transform>
+ <name>Filter rows</name>
+ <type>FilterRows</type>
+ <description/>
+ <distribute>Y</distribute>
+ <custom_distribution/>
+ <copies>1</copies>
+ <partitioning>
+ <method>none</method>
+ <schema_name/>
+ </partitioning>
+ <compare>
+ <condition>
+ <conditions>
+</conditions>
+ <function>=</function>
+ <leftvalue>rows_count</leftvalue>
+ <negated>N</negated>
+ <operator>-</operator>
+ <value>
+ <isnull>N</isnull>
+ <length>-1</length>
+ <mask>####0;-####0</mask>
+ <name>constant</name>
+ <precision>0</precision>
+ <text>2</text>
+ <type>Integer</type>
+ </value>
+ </condition>
+ </compare>
+ <send_false_to>Abort</send_false_to>
+ <attributes/>
+ <GUI>
+ <xloc>560</xloc>
+ <yloc>240</yloc>
+ </GUI>
+ </transform>
+ <transform>
+ <name>Group by</name>
+ <type>GroupBy</type>
+ <description/>
+ <distribute>Y</distribute>
+ <custom_distribution/>
+ <copies>1</copies>
+ <partitioning>
+ <method>none</method>
+ <schema_name/>
+ </partitioning>
+ <add_linenr>N</add_linenr>
+ <all_rows>N</all_rows>
+ <directory>${java.io.tmpdir}</directory>
+ <fields>
+ <field>
+ <aggregate>rows_count</aggregate>
+ <subject>name</subject>
+ <type>COUNT_ALL</type>
+ </field>
+ </fields>
+ <give_back_row>Y</give_back_row>
+ <group>
+</group>
+ <ignore_aggregate>N</ignore_aggregate>
+ <prefix>grp</prefix>
+ <attributes/>
+ <GUI>
+ <xloc>400</xloc>
+ <yloc>240</yloc>
+ </GUI>
+ </transform>
+ <transform>
+ <name>MongoDB input</name>
+ <type>MongoDbInput</type>
+ <description/>
+ <distribute>N</distribute>
+ <custom_distribution/>
+ <copies>1</copies>
+ <partitioning>
+ <method>none</method>
+ <schema_name/>
+ </partitioning>
+ <connection>${MONGO_CONNECTION}</connection>
+ <fields_name/>
+ <collection>m_objectid_updates</collection>
+ <json_field_name>json</json_field_name>
+ <json_query/>
+ <output_json>N</output_json>
+ <query_is_pipeline>N</query_is_pipeline>
+ <execute_for_each_row>N</execute_for_each_row>
+ <mongo_fields>
+ <mongo_field>
+ <field_name>name</field_name>
+ <field_path>$.name</field_path>
+ <field_type>String</field_type>
+ </mongo_field>
+ <mongo_field>
+ <field_name>status</field_name>
+ <field_path>$.status</field_path>
+ <field_type>String</field_type>
+ </mongo_field>
+ </mongo_fields>
+ <attributes/>
+ <GUI>
+ <xloc>176</xloc>
+ <yloc>144</yloc>
+ </GUI>
+ </transform>
+ <transform_error_handling>
+ </transform_error_handling>
+ <attributes/>
+</pipeline>
diff --git
a/plugins/tech/mongodb/src/main/java/org/apache/hop/pipeline/transforms/mongodboutput/MongoDbOutputData.java
b/plugins/tech/mongodb/src/main/java/org/apache/hop/pipeline/transforms/mongodboutput/MongoDbOutputData.java
index 4fd4096857..49d356d73e 100644
---
a/plugins/tech/mongodb/src/main/java/org/apache/hop/pipeline/transforms/mongodboutput/MongoDbOutputData.java
+++
b/plugins/tech/mongodb/src/main/java/org/apache/hop/pipeline/transforms/mongodboutput/MongoDbOutputData.java
@@ -815,6 +815,8 @@ public class MongoDbOutputData extends BaseTransformData
implements ITransformDa
{
String val = hopType.getString(hopValue);
if (hopValueIsJSON) {
+ // Wrap so BSON 5.x can decode extended JSON scalars (e.g.
{"$oid":"..."})
+ // that are not top-level documents. See
https://github.com/apache/hop/issues/7183
valueToSet = Document.parse("{\"value\":" + val +
"}").get("value");
} else {
valueToSet = val;
diff --git
a/plugins/tech/mongodb/src/test/java/org/apache/hop/pipeline/transforms/mongodboutput/MongoDbOutputDataTest.java
b/plugins/tech/mongodb/src/test/java/org/apache/hop/pipeline/transforms/mongodboutput/MongoDbOutputDataTest.java
index 0f40445980..85a0872a06 100644
---
a/plugins/tech/mongodb/src/test/java/org/apache/hop/pipeline/transforms/mongodboutput/MongoDbOutputDataTest.java
+++
b/plugins/tech/mongodb/src/test/java/org/apache/hop/pipeline/transforms/mongodboutput/MongoDbOutputDataTest.java
@@ -260,6 +260,7 @@ class MongoDbOutputDataTest {
@Test
void testGetQueryObjectWithIncomingObjectIdJson() throws HopException {
+ // Regression for #7183: extended JSON ObjectId as match field with
json_field=Y
MongoDbOutputMeta.MongoField field = new MongoDbOutputMeta.MongoField();
field.inputJson = true;
field.updateMatchField = true;