Edit result objects in the Output Panel

Lucas Soares shared this idea 5 years ago
Completed

Hello.


In the tree visualization of output panel, I can edit values directly to the table.


I think this should be possible even in the json output view with left click and selecting a 'edit' option. This should open a viewer like the one in the picture with edit mode enabled and an option to "save" it.

/5f8ddbe8c802f6c43314c4efd75dc5cd

But with the option of editing the json itself and a option to "save" it.


All fields must be updated with a set operation because the json may be incomplete (with projections).


This would be great.


Thank you

Replies (6)

photo
1

You can click "Edit document" button in the toolbar or press"CMD+E" in the output panel to edit document in a new tab. It uses "update" method and "$set" operation.

/ba83ff27bd2dcab5d4b6394eaf454a20

The following is the generated update statement.

/0aeeb6e4140e22cbbedce96166389c85

photo
1

Hello.


Your example show you editing the document in the TREE output view.


But if I change the view to JSON view, I can't edit the document.


I saw this feature in the software Studio 3T, and since I prefer the JSON output view, would be nice to be able to edit the document in the same view. Look:


https://cdn.discordapp.com/attachments/411040628806516737/484453354601185321/editing_document.mp4

photo
1

Thank you for your feedback, we will add viewing and editing features to JSON view

photo
1

Thank you very much!!


If a projection is made hiding some fields, my suggestion is to load the entire document again in the json screen to let the user edit the entire object. The problem is if the document is updated/deleted by other application or user in the same time.


Maybe if you guys could create a code to check the value differences of the first loaded JSON and the user edition and update only those fields.. And if the _id is hidden, the edit button should be inactive ^^


Well, only ideas! Thank you!

photo
1

I don't think it's a good idea to load the entire document because a single MongoDB document can be very large, and there's certainly a reason for the user to pick only a few fields. I prefer to generate an update statement with $set operations in another editor tab, like tree view "edit document" function, where the user edits, modifies and run the update script.

If you modify a single field, it is better to switch to tree view.

photo
1

Got your point!


Thank you.

Leave a Comment
 
Attach a file