Upgrade Instructions 6.0.0 - Upgrading the Mongo Event Object Field Names

1) Establish the IDs of User Defined Types

Run the following SQL query against the Flex MySQL database:

SELECT ID_, OLD_USER_DEFINED_ID_
FROM MIO_OBJECT_TYPE
WHERE USER_DEFINED_ = TRUE
ORDER BY ID_;       

If this query returns no results, this means there are no event documents to update, and there is no need to progress to stage 2.

2) Update Event Documents

For each row returned by the query in step 1, run the following MongoDB commands, replacing <ID_> and <OLD_USER_DEFINED_ID> values accordingly.

use flex-events
db.event.updateMany({objectTypeId: <OLD_USER_DEFINED_ID_>}, {$set: {"objectTypeId": NumberInt(<ID_>)}})
db.notification.updateMany({"event.objectTypeId": <OLD_USER_DEFINED_ID_>}, {$set: {"event.objectTypeId": NumberInt(<ID_>)}})         
Note: Not all executions of this command will update event documents.

Was this article helpful?