IntelliJ Database tool - Mongo read-only
Asked Answered
T

2

8

I'm connecting to a local MongoDB instance installed through brew via the IntelliJ Database tool. I can see and query things; but as soon as I try to update a record eg set a database lock back to false I get the error This table is read-only. Changes cannot be applied.

The same thing doesn't happen using the console. I've attempted to toggle the Read-only checkbox under Datasource properties > Options.

Is there another setting somewhere else I'm missing?

Tamikatamiko answered 16/12, 2019 at 22:38 Comment(0)
S
9

It is not yet supported. Please vote for this request: DBE-9375.

Sihonn answered 17/12, 2019 at 12:46 Comment(0)
C
0

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!

Catenoid answered 14/12, 2023 at 10:18 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.