Hi there,
While using the connector and returning the data without being flattened, I'm recieving ObjectIds like this
"_id":{"timestamp":1638209485,"counter":13050635,"randomValue1":12445288,"randomValue2":25}
instead of the hash I see in MongoDB. How can I fix this?
Solved! Go to Solution.
Looks like you are using Dataflow. This is not Integration Connector. For Dataflow, please refer to their support channel: https://cloud.google.com/dataflow/docs/support/getting-support
Could you please share project ID and connection details?
project ID is "manteca-bi". In this screenshot I tried to run an UDF to parse the _id to string but that didn't work either (had console errors). Here is the script:
/**
* Converts a MongoDB ObjectId to its string representation.
*
* @PARAM {Object} obj The MongoDB document.
* @returns {String} The string representation of the ObjectId.
*/
function parseObjectIdToString(obj) {
if (!obj._id) {
return 'null';
}
// Check if _id is already a string
if (typeof obj._id === 'string') {
return obj._id;
}
// Assuming _id is an ObjectId
return obj._id.toString();
}
Looks like you are using Dataflow. This is not Integration Connector. For Dataflow, please refer to their support channel: https://cloud.google.com/dataflow/docs/support/getting-support