We are using Mongodb 4.4 and RestHeart 3.6. Now that Mongodb 4.4 is coming to EOL and mongodb atlas clusters will automatically upgrade to Mongodb 5.0 on Feb-29 we have few questions:
Which RestHeart version to choose? It is not clear which RestHeart version supports MongoDB 5.0 https://restheart.org/docs/
We are trying to understand what will be the breaking changes moving up from RestHeart 3.6 to 7.0. We know one thing that RestHeart Hooks (bidclips.restheart.hooks) will not work, but what else?
What is the alternative of org.restheart.metadata.hooks.Hook?
You're operating with a version of RESTHeart that's five years old and no longer supported!
I highly recommend upgrading to the most recent version, which is currently v7.7.2. This latest version is compatible with MongoDB versions 5, 6, and 7, marking a significant improvement over the earlier releases.
Since version 3, RESTHeart has transformed from merely providing a MongoDB API to becoming a comprehensive development framework, while still offering a MongoDB API out-of-the-box.
To upgrade your system, there are two primary changes to consider:
Refactoring Hooks into Interceptors: Your existing Hooks need to be converted into Interceptors. This is a crucial step to align with the new architecture. You can find detailed guidance on this process in the RESTHeart documentation at RESTHeart Interceptors Documentation. Additionally, examples of plugins, including some Interceptors, are available at RESTHeart GitHub Examples, which can be very helpful.
Changes in Write Semantics for MongoDB REST API: The approach to write operations has been updated. Unlike previous versions where all write methods defaulted to upsert behavior, the current version introduces controlled write modes through the
?wm=insert|update|upsertparameter, with defaults based on the HTTP method used:POSTmethod defaults toinsert, meaning it's used to create new documents.PUTandPATCHmethods default toupdate, wherePUTreplaces an existing document andPATCHupdates specific properties of an existing document.For more details on the write modes and how to use them effectively, you can refer to the RESTHeart documentation on write operations at RESTHeart Write Modes Documentation.