コード例 #1
0
ファイル: App.cpp プロジェクト: MinHuZ/robomongo
 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));
 }
コード例 #2
0
ファイル: App.cpp プロジェクト: MinHuZ/robomongo
 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));
 }
コード例 #3
0
ファイル: App.cpp プロジェクト: MinHuZ/robomongo
    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));
    }