Kyungeun Park
Kyungeun Park

Reputation: 153

Drop database in DataGrip JetBrains

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

I want to know why. Help me.

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: ...

Upvotes: 2

Views: 1946

Answers (1)

Vasilii Chernov
Vasilii Chernov

Reputation: 1464

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

Upvotes: 0

Related Questions