Note - Migration to MongoDB 6.0 - changes to be aware of!
brainCloud BaaS will be upgraded to MongoDB 6.0 on Wednesday, September 25th, starting at 8pm Eastern. It is a rolling upgrade that may take up to 3 hours to complete. All API and Portal services will be fully available during the upgrade. The Portal will NOT be disabled.
Note that all brainCloud Private Instances will be upgraded in the following weeks - before October 31st, 2024.
brainCloud 5.4 has been tested to be fully compatible with MongoDB 6.0.
That said, MongoDB 6.0 contains an Important Change that brainCloud developers must be aware of:
In MongoDB 6.0, $regex Find Queries No Longer Ignore Invalid Regex. This means that while invalid $regex expressions were ignored in MongoDB 5.0 -- in MongoDB 6.0, the same query will return an error.
For example, in MongoDB 5.0, the following query, which includes an invalid regex option (i.e., "bad"), returns a successful database response with a document.
In MongoDB 6.0, that same query returns an error from the database - thus, brainCloud also returns an error.
This change only affects brainCloud's list and paging-style calls (which accept custom query JSON) - and ONLY apply if the developer-provided queries have invalid $regex or $options. These calls include:
- Custom Entity - GetEntityPage(), SysGetEntityPage()
- Entity - GetList(), GetListCount(), GetPage()
- Global Entity - GetList(), GetListCount(), GetPage(), GetSystemEntityList() GetSystemEntityListCount(), GetSystemEntityPage()
- Group - ListGroupsPage(), GetRandomGroupsMatching(), ReadGroupEntitiesPage(), SysGetRandomGroupsMatching(), SysListGroupsPage(), SysReadGroupEntitiesPage()
- Item Catalog - GetCatalogItemsPage(), SysGetCatalogItemsPage()
- Leaderboard - SysGetLeaderboardConfigsPage()
- Messaging - GetMessagesPage(), SysGetMessagesPage()
- RedemptionCode - SysGetCodeTypePage()
- User - SysGetPage()
- User Items - GetUserItemsPage()
So - in summary:
- If your app isn't using $regex expressions in your query - you have nothing to worry about
- If your app is using VALID $regex expressions and valid $options - you have nothing to worry about
- If your app is using INVALID $regex expressions or $options - then brainCloud may now flag that error
A description of MongoDB 6.0 $regex and $options can be found here.
Feel free to reach out to brainCloud Support if you have questions.