Upgrade Instructions 6.0.0 - Creating Events Index

1) Drop old indexes:

Run the following MongoDB command to delete the old indexes:

Note: Some of these may not exist, so ignore any errors in this case.
use flex-events
db.event.dropIndex("mioObjectId")
db.event.dropIndex("userId_1_mioObjectId_1")
db.event.dropIndex("userId_1")
db.event.dropIndex("userId_1_timestamp_-1_priority_1")
db.event.dropIndex("priority_1")
db.event.dropIndex("accountId_1_timestamp_-1_workspaceId_1")
db.event.dropIndex("timestamp_-1_accountId_1_workspaceId_1_mioObjectTypeId_1")
db.event.dropIndex("mioObjectId_1_timestamp_-1_accountId_1_workspaceId_1")
db.event.dropIndex("mioObjectTypeId_1_workspaceId_1_accountId_1")
db.event.dropIndex("accountId_1_workspaceId_1")
db.event.dropIndex("userId_1_timestamp_-1_event.priority_1")  
            

2) Create new indexes

Run the following MongoDB command to create the new events indexes:

use flex-events
db.event.createIndex({'userId' : 1}, {name: "userId", background: true})
db.event.createIndex({'userId' : 1, 'objectId': 1}, {name: "userId_objectId", background: true})
db.event.createIndex({'userId' : 1, 'timestamp': -1, 'priority': 1}, {name: "userId_timestamp_priority", background: true})
db.event.createIndex({'priority' : 1}, {name: "priority", background: true})
db.event.createIndex({'accountId' : 1, 'timestamp': -1, 'workspaceId': 1}, {name: "accountId_timestamp_workspaceId", background: true})
db.event.createIndex({'timestamp': -1, 'accountId': 1, 'workspaceId': 1, 'objectTypeId': 1}, {name: "timestamp_accountId_workspaceId_objectTypeId", background: true})
db.event.createIndex({'objectId': 1, 'timestamp': -1, 'accountId': 1, 'workspaceId': 1}, {name: "objectId_timestamp_accountId_workspaceId", background: true})
db.event.createIndex({'objectTypeId': 1, 'workspaceId': 1, 'accountId': 1}, {name: "objectTypeId_workspaceId_accountId", background: true})
db.event.createIndex({'accountId': 1, 'workspaceId': 1}, {name: "accountId_workspaceId", background: true})    
 
https://help.ooyala.com/sites/all/libraries/dita/en/media-logistics/flex/dev/60/upgrade_instructions_60_creating_events_index.html

Was this article helpful?