MongoDB DBA · Question 382 · Single choice

Consider the following set of commands in the mongo shell: use admin db.setLogLevel(5, "index") Which of the following statements is true after the logging level is changed by the above command? Choose the best answer:

Answer options

  1. A.
    Only indexes created in the admin database will be logged
  2. B.
    Queries that require index access will be logged
  3. C.
    Queries taking over 5 milliseconds will be logged with the index the used
  4. D.
    Debug messages will be indexed in the log file
  5. E.
    Index management commands will be logged with debug severity

Answer confidence: High

Correct answer: E

Explanation language: Chinese

db.setLogLevel(5, "index") 是把 index 这个日志组件的详细度调到 5(debug),因此与索引相关的管理/操作会以 debug 级别写进日志(D)。它按组件生效而不是按数据库生效(A 错),不是给日志建索引(B 错),也与 5 毫秒的慢查询阈值无关(C 错)。

Papers containing this question

This question appears in 2 bank records. Public pages combine identical prompts and options. Selected questions display the highest-confidence record; the others show a short preview. Paper-based learning preserves each record's answer, explanation, and confidence.

AUTHOR · PROJECTS · OPEN SOURCE

Author & MongoDB projects

Building data platforms, MongoDB migration and sync tools, and cloud operations products.

Contact the author for any MongoDB needs.

Contact the author ↗mlhp123@outlook.com

Support the author

If this question bank helps you, optional donations are welcome.

Scan with Alipay to support the authorOpen full-size donation image ↗