Join us Sept 17 at .local NYC! Use code WEB50 to save 50% on tickets. Learn more >
MongoDB Event
Docs Menu
Docs Home
/
MongoDB 매뉴얼
/ / /

setVerboseShell()

참고

여기에 나열된 네이티브 메서드는 레거시 mongo shell 입니다.

에서 네이티브 메서드를 사용하려면 의 mongosh 네이티브 메서드를 mongosh 참조하세요.

setVerboseShell()

setVerboseShell() 메서드는 각 작업의 지속 시간을 출력하도록 mongosh 를 구성합니다.

setVerboseShell() 의 형식은 다음과 같습니다.

setVerboseShell(true)

setVerboseShell() 은(는) 하나의 부울 매개변수를 사용합니다. true 를 지정하거나 매개변수를 비워 두어 상세 shell 을 활성화합니다. 비활성화하려면 false 를 지정합니다.

다음 예시 에서는 상세 shell 의 동작을 보여 줍니다.

  1. mongosh 에서 verbose shell 을 true로 설정하다 합니다.

    setVerboseShell(true)
  2. 상세 shell 을 true로 설정하다 하고 db.collection.aggregate()을 실행 .

    db.restaurants.aggregate(
    [
    { $match: { "borough": "Queens", "cuisine": "Brazilian" } },
    { $group: { "_id": "$address.zipcode" , "count": { $sum: 1 } } }
    ]
    );
  3. 이제 작업 결과를 반환하는 것 외에도 mongosh 는 작업 기간에 대한 정보를 표시합니다.

    { "_id" : "11377", "count" : 1 }
    { "_id" : "11368", "count" : 1 }
    { "_id" : "11101", "count" : 2 }
    { "_id" : "11106", "count" : 3 }
    { "_id" : "11103", "count" : 1 }
    Fetched 5 record(s) in 0ms

돌아가기

절전 모드()

이 페이지의 내용