How can I check my query history when using Robo 3T for MongoDB? - mongodb

When I use Robo 3T for MongoDB, can I have my query history scripts stored in Robo 3T, just like pl/sql developer for oracle? this is a very key function cause often times I need to check my previously query inputs.

Here are some simple ways to check query history in Robo 3T:
Switch to the View tab then choose Logs option.
Click on Logs button in the bottom left corner of the screen to show the Logs panel.
Shortcuts are Ctrl + L for trigger Logs panel.

Related

IntellijIdea Mongo connection too slow and lack of capabilities

I'm trying to use IntellijIdea in order to connect to MongoDB but it seems to work too slow. A simple read request might take up to 5 secs meanwhile Robo 3T works almost instantly. Is it a common and known behavior (some issue with mongo driver for example) or is it my local issue?
Also I can't find how to manage collections\databases via GUI. Let's say I want to create a new database: I right-click in order to get a context menu, go to "new" section and everything I can do is to add a new datasource, driver or just jump to console.
Also I can't find db users for the given database. There is just no such folder under selected db.
Can I do such kind of management via IntellijIdea database GUI?
Unfortunately we found a problem with latest MongoDB driver, which causes slow operations. Please open up data source properties, switch to Drivers tab, select MongoDB and switch to v.1.11.
And I've created 2 feature request based on your feedback, please follow and vote to get noticed on any updates:
For database management GUI https://youtrack.jetbrains.com/issue/DBE-14252
For user list https://youtrack.jetbrains.com/issue/DBE-14253

Truncate table in DBeaver right click menu/GUI

I am trying to find an option to truncate table in the right click menu or somewhere in the GUI of DBeaver. The database is SQL Server.
Is there any other option rather that explicitly writing the truncate script?
In DBeaver 7.2.4 - Right click on a table, that needs to be truncated, choose Tools->Truncate, click 'Start'. That's all.
This feature is not yet available for SQL Server. May be DBeaver will include this in their new versions.

How to sort databases alphabetically in DBeaver Database Navigator

In the Database Navigator the databases are not sorted alphabetically.
This is a pain to use when you have many databases on a server.
To sort the databases alphabetically :
go to the Window - Preferences menu
click on "User Interface" (DBeaver or Database in older versions), then Navigator
check "Order elements alphabetically"
disconnect + connect each connection (or just restart DBeaver)
As of now the option has moved again:
Window -> Preferences
User Interface -> Navigator
The accepted answer is not correct for Mac at least.
To sort the databases alphabetically:
In the top menu, click Window then Preferences.
Expand the DBeaver section.
Click on Navigator.
Enable "Order elements alphabetically".
Click "Apply and Close".
Notice your databases are sorted alphabetically.
If they're not, then disconnect and connect the connection, or just restart DBeaver.

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.
In the latest version, there is a "_MongoSH" in the bottom left corner of the window.
Thx to #Boštjan Pišler for the hint about a new feature.
Old answer:
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).
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"
At the bottom left, _MONGOSH:
There you can call updateMany and any other methods available in the MongoSH syntax
You can use mongo MongoSH. Currently its in Beta.
Just move your mouse over a document and find a little pencil. You will enter in update mode. You can change fields, values, arrays, etc.

How do I run arbitrary SQL on DBeaver?

Ok, so this may seem like a stupid question but I'm fighting DBeaver and so far it's winning and Google is refusing to pick a side.
I've worked out how to explore the database, view the structure of tables, I can even view the data of a table and filter it.
But if I just want to run an arbitrary SQL statement how do I do that?
And 30 seconds after posting I found the answer. There is an SQL Editor menu appeared at the top of the screen (not in the Database Navigator). Selecting SQL Editor from that brings up a query window I can type SQL into.