MongoShell *App::openShell(MongoCollection *collection,const QString &filePathToSave) { ConnectionSettings *connection = collection->database()->server()->connectionRecord(); connection->setDefaultDatabase(collection->database()->name()); QString script = detail::buildCollectionQuery(collection->name(), "find({})"); return openShell(connection, ScriptInfo(script, true, CursorPosition(0, -2), QtUtils::toQString(collection->database()->name()),filePathToSave)); }
MongoShell *App::openShell(MongoDatabase *database, const QString &script, bool execute, const QString &shellName, const CursorPosition &cursorPosition,const QString &filePathToSave) { ConnectionSettings *connection = database->server()->connectionRecord(); connection->setDefaultDatabase(database->name()); return openShell(connection, ScriptInfo(script, execute, cursorPosition, shellName,filePathToSave)); }
MongoShell *App::openShell(MongoServer *server,const QString &script, const std::string &dbName, bool execute, const QString &shellName, const CursorPosition &cursorPosition,const QString &filePathToSave) { ConnectionSettings *connection = server->connectionRecord(); if (!dbName.empty()) connection->setDefaultDatabase(dbName); return openShell(connection, ScriptInfo(script, execute, cursorPosition, shellName,filePathToSave)); }