Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to execute update ($set) queries in MongoDB Compass tool?

I'm new to MongoDB Compass tool and am trying to update a field in my collection. Please can someone suggest where the update query must be written. Could find no options or panes in the tool to write custom queries be it selection / updation for that matter.

In the Default Window only the selection/projection/restriction options are found. Any help is much appreciated.

like image 779
Patrick Avatar asked Mar 05 '18 12:03

Patrick


2 Answers

I had the same issue, it looks like a simple feature to implement (since document updates are possible) but... AFAIK there is no such option in compass, you can do it through mongodb shell (CLI client).

UPDATE: And it seems that it is possible now, although in beta, in the latest version (1.22.1) there is a "_MongoSH Beta" in the bottom left corner of the window. Thx to @Boštjan Pišler for the hint about a new feature.

like image 190
Ivan Marjanovic Avatar answered Sep 28 '22 02:09

Ivan Marjanovic


The tool was recently updated with a shell (currently in beta) which is accessible by clicking the dark bar on the bottom of the window "_MongoSH"

Mongosh beta tab

like image 45
Boštjan Pišler Avatar answered Sep 28 '22 02:09

Boštjan Pišler