<aside> 💡 Windows 환경을 기준으로 설명되어있습니다.

</aside>

<aside> 🍎 macOS 에서의 텍스트 편집은 다음 링크를 참고해주세요 https://knowledge.autodesk.com/ko/search-result/caas/sfdcarticles/sfdcarticles/KOR/How-to-create-a-plain-text-file-using-TextEdit-on-a-Mac.html

</aside>

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/6c000699-8058-4c11-9f3f-9cd253b238d9/1.png

Robo 3T 설치 및 접속

DBCommandCursor.prototype.toCSV = function(deliminator, textQualifier) 
{
    var count = -1;
    var headers = [];
    var data = {};

    deliminator = deliminator == null ? ',' : deliminator;
    textQualifier = textQualifier == null ? '\\"' : textQualifier;

    var cursor = this;

    while (cursor.hasNext()) {

        var array = new Array(cursor.next());

        count++;

        for (var index in array[0]) {
            if (headers.indexOf(index) == -1) {
                headers.push(index);
            }
        }

        for (var i = 0; i < array.length; i++) {
            for (var index in array[i]) {
                data[count + '_' + index] = array[i][index];
            }
        }
    }

    var line = '';

    for (var index in headers) {
        line += textQualifier + headers[index] + textQualifier + deliminator;
    }

    line = line.slice(0, -1);
    print(line);

    for (var i = 0; i < count + 1; i++) {

        var line = '';
        var cell = '';
        for (var j = 0; j < headers.length; j++) {
            cell = data[i + '_' + headers[j]];
            if (cell == undefined) cell = '';
            cell = cell + '';
            line += textQualifier + cell.replace(/\\n/gi, "\\\\n") + textQualifier + deliminator;
        }

        line = line.slice(0, -1);
        print(line);
    }
}

db.추출할데이터베이스명.aggregate([]).toCSV()

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/bbeff910-b609-42ff-959d-e81e7afddc76/2.png

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/a85694f4-fb47-4f0f-ae87-25ddcf29e57b/3.png

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/29e559dc-b2b5-4e5d-a9cf-ed388a24c5de/4.png

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/a62c9470-b479-4512-a609-668033327180/5.png