Drop database in DataGrip JetBrains

1.6k Views Asked by At

It's database drop in mongo shell, but not in Datagrip.

I want to know why. Help me.

  • OS: Windows
  • MongoDB shell version: v4.4.1
  • DataGrip: 2020.2.3

Mongo Shell

> use test
switched to db test

> db.Hi.insert({title:"temp"});
WriteResult({ "nInserted" : 1 })

> show dbs;
admin   0.000GB
config  0.000GB
local   0.000GB
test    0.000GB

> db.dropDatabase();
{ "dropped" : "test", "ok" : 1 }

> show dbs;
admin   0.000GB
config  0.000GB
local   0.000GB

DataGrip console

use test;
db.Hi.insert({title:"temp"});
show dbs;
db.dropDatabase(); // Error
show dbs;

DataGrip Err history

java.lang.Exception: TypeError: invokeMember (dropDatabase) on JavaObject[com.mongodb.mongosh.service.JavaServiceProvider@60231c39 (com.mongodb.mongosh.service.JavaServiceProvider)] failed due to: Arity error - expected: 3 actual: 2
TypeError: invokeMember (dropDatabase) on JavaObject[com.mongodb.mongosh.service.JavaServiceProvider@60231c39 (com.mongodb.mongosh.service.JavaServiceProvider)] failed due to: Arity error - expected: 3 actual: 2
at Proxy.<anonymous> (all-standalone.js:77453:67)
at step (all-standalone.js:77314:23)
at Object.<anonymous> (all-standalone.js:77295: ...
1

There are 1 best solutions below

0
On

It looks like you need to update your MongoDB JDBC Driver to the latest version 1.11.

With the latest driver version your queries are working correctly:
working solution