I've come across the same issue where DataGrip was not allowing modifications to MongoDB collections and was stuck in read-only mode. After some investigation, I found that DataGrip did not support MongoDB editing until a certain version. However, as of version 2021.1, JetBrains has implemented this feature.
To edit MongoDB collections directly within DataGrip, you need to ensure that:
You're using a version of DataGrip that supports MongoDB editing (2021.1 or later).
Your MongoDB user has the necessary write permissions on the database.
The MongoDB JDBC driver is updated to the latest version that supports editing.
If you're using an older version of DataGrip or an incompatible driver, you might still face read-only limitations. In this case, updating DataGrip and the MongoDB driver should resolve the issue.
For those still facing the read-only issue on compatible versions, try checking the "Data Sources and Drivers" dialog for any read-only settings that might be enabled. Also, ensure that the connection is configured correctly with the right authentication details.
Here's a quick guide to check your settings:
Open DataGrip and go to File > Data Sources.
Select your MongoDB data source and click on the Options tab.
Make sure the Read-only checkbox is not selected.
If everything is set up correctly, you should be able to edit the MongoDB documents by opening the collection and double-clicking on the field you want to edit or by using the MongoDB console in DataGrip to run update commands.
Hope this helps future users facing similar issues!