Docs Menu

Docs HomeMongoDB Command Line Interface

Customize the MongoDB CLI Output Using a Go Template

You can customize the MongoDB CLI output fields and format using a Go template. The template can be specified with the command for a simple output or through a separate file for a complex output. For information on the template, see Package template. For information on the types and properties available for each response, see:

You can specify a template with the command using the --output or -o option:

--output|-o go-template="{{<template>}}"

You can specify a template using a file using the --output or -o option:

--output|-o go-template-file="<path-to-template-file>"
←  Enable Autocomplete for the MongoDB CLIQuick Start →
Give Feedback
© 2022 MongoDB, Inc.


  • Careers
  • Investor Relations
  • Legal Notices
  • Privacy Notices
  • Security Information
  • Trust Center
© 2022 MongoDB, Inc.