geetesh-gupta / Mongo-DB-Browser

Mongo DB Browser plugin for JetBrains
Apache License 2.0
7 stars 3 forks source link

Edit not working? #9

Open dorbareket opened 1 year ago

dorbareket commented 1 year ago

Expected behavior:

Maybe Edit button is supposed to be available for any field of the document? I'm not sure what was intended.

Clarification: Double clicking does nothing as well. Effectively this means I can only view documents, which makes this amazing plugin useless.

Thx!

geetesh-gupta commented 1 year ago

As of now, when you will Right Click on the _id field, you will get the option to Edit the document. This has been the designed fliw from the start. Please try to validate if this is working for you.

geetesh-gupta commented 1 year ago

Hi @dorbareket, is the above approach working for you? If not, please let me know. Thanks

dorbareket commented 1 year ago

Hi @geetesh-gupta On right click on _id field I do get the Edit option, but nothing happens when I press it

P.S sorry for the delay

geetesh-gupta commented 1 year ago

Right clicking on _id and clicking on Edit opens a window titled Edition which allows to edit each key-value.

If it is not working for you, it would be great if you can share a short video for the same.

Also, please share if any error is coming on clicking Edit. Errors come at bottom right corner and are also available via a Alert icon in bottom bar on right side.

dorbareket commented 1 year ago

I just discovered I can create new documents and edit them, but I cannot edit existing documents using your tool (it does work from 3t studio or DataGrip). There's no issue logged under notifications, it's just that absolutely nothing happens. Here's a video: MongoDBBrowserEdit

Thanks!

geetesh-gupta commented 3 months ago

Hi @dorbareket , sorry for delayed response. Are you still facing the issue? Did u check if u have edit access to the database your are trying to edit?

dorbareket commented 2 months ago

@geetesh-gupta yes I'm an admin, I use Studio3T and I can edit whatever i want

berndlueneburg commented 2 months ago

Hi, @geetesh-gupta. I experience the same edit issue as dorbareket. Tried with no user (local default) and with different admin user setups. Edit does not work as expected. Thanks!

geetesh-gupta commented 2 months ago

I just now created a new collection with a document using Studio3T, then went to the plugin, loaded that collection, right clicked on the document _id, I was able to see the edit menu and edit the document.

One thing I observe in @dorbareket video, that the document you are trying to edit, is having the _id as 1, which in an ideal scenario should be something like 6697fc91313970259c0b06fc. Maybe that's the issue.

@berndlueneburg Can you share the screenshot of your collection, maybe if their is any similarity?

juliojm13 commented 2 months ago

I just now created a new collection with a document using Studio3T, then went to the plugin, loaded that collection, right clicked on the document _id, I was able to see the edit menu and edit the document.

One thing I observe in @dorbareket video, that the document you are trying to edit, is having the _id as 1, which in an ideal scenario should be something like 6697fc91313970259c0b06fc. Maybe that's the issue.

@berndlueneburg Can you share the screenshot of your collection, maybe if their is any similarity?

I have the same issue and I agree that having an _id that is not an uidd like "my_settings" is the problem. But why is this a problem? In other clients like studio 3T that doesn't happen, it seems like a bug on your side for me, we can not change our _id values just for updating the data. Thanks for your help in advance.

berndlueneburg commented 2 months ago

I just now created a new collection with a document using Studio3T, then went to the plugin, loaded that collection, right clicked on the document _id, I was able to see the edit menu and edit the document.

One thing I observe in @dorbareket video, that the document you are trying to edit, is having the _id as 1, which in an ideal scenario should be something like 6697fc91313970259c0b06fc. Maybe that's the issue.

@berndlueneburg Can you share the screenshot of your collection, maybe if their is any similarity? No, i use standard MongoDb Ids:

Screenshot 2024-07-17 213706

dorbareket commented 2 months ago

I also use standard ids. I just created that temporary DB for the video and to try with a clean db

geetesh-gupta commented 2 months ago

So, we are able to know the issue that _id is not in standard format. Will check for the support for other IDs. As of now, it only supports the ObjectIds.

berndlueneburg commented 2 months ago

So, we are able to know the issue that _id is not in standard format. Will check for the support for other IDs. As of now, it only supports the ObjectIds.

as I understand @dorbareket and i use standard MongoDb ObjectIds and the Edit issue appears anyhow. So it cannot be the problem of a different id format. I think the hottest hint is that newly added documents within the MongoDb Browser are editable but existing ones not. Does this eventually help you?

geetesh-gupta commented 2 months ago

I tried creating documents from Studio3T. I was able to edit them in the plug-in.

dorbareket commented 2 months ago

So umm

  1. With the plugin, I can totaly create a document with string/numberInt _id. The new document is NOT EDITABLE, albeit edit button is in color. On creation I can add fields, but not afterwards. image

  2. I tried creating a document from Studio3T with objectId and indeed I am able to edit it from the plugin.

So @geetesh-gupta I think you are right, edit only works when _id is an ObjectId. It doesn't work if it's a string/NumberInt image image image

So the plugin allows creating documents with _id that is not ObjectId, but wont' allow editing it

geetesh-gupta commented 2 months ago

Correct @dorbareket. Will try to see if we can fix it.