Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to run Native mongo query in mongoDB Compass?

I'm trying to find data using native Mongo queries, but can't do it. It seems mongoDB Compass only provides filter property for fetching data.

As in case of SQL's (say phpmyadmin, mysqlWorkbench, toad), we can easily execute native queries directly in the QueryEditor. Similarly Is there any console (query editor) in mongodb compass where I can execute direct queries? If yes, then tell me the breadcrumb.

Note: I don't want to use robomongo, robo3T and other mongo UI tools.

like image 436
Jabongg Avatar asked Feb 06 '19 06:02

Jabongg


People also ask

Can I run query in MongoDB compass?

Yes, Mongo compass provides only filter option(Query Bar) to do queries on specific collection.

What is native query in MongoDB?

By “native query”, are you referring to a JavaScript query in the mongo shell? The Java driver provides a full interface for querying MongoDB. To get started, see MongoDB Java Driver Quick Start and the Java Driver Tutorials. Here is an example with “native” query usage.


2 Answers

Looks like they're adding a shell to Compass:

https://www.mongodb.com/blog/post/new-compass-comes-with-shell

"In Compass 1.22 Beta we are introducing the integrated MongoDB Shell, which allows you to run database commands and scripts directly from Compass."

like image 99
JosephScript Avatar answered Oct 08 '22 21:10

JosephScript


I like to use Robo3T (https://robomongo.org/), which has a nice interface and is not as restrictive as the Compass Query bars

like image 24
rlpatrao Avatar answered Oct 08 '22 21:10

rlpatrao