Docs HomeMongoDB Shell

Snippet Commands代码段命令

On this page本页内容

Warning

This feature is experimental. MongoDB does not provide support for Snippets. 此功能是实验性的。MongoDB不支持Snippets。This feature may be changed or removed at any time without prior notice.此功能可能随时更改或删除,恕不另行通知。

Bugs are not expected, however should you encounter one, please open an issue in the GitHub repository for this project.预计不会出现错误,但如果您遇到错误,请在GitHub存储库中打开此项目的问题。

This document provides an overview of the commands that are available to work with snippets.本文档概述了可用于处理snippets的命令。

Commands命令

Command命令Description描述
helpShow the help text or information about a specific snippet. 显示有关特定代码段的帮助文本或信息。See an example.请参见示例
snippet help
snippet help <snippet-name>
infoShow information about configured snippet repositories. 显示有关已配置的代码段存储库的信息。See an example.请参见示例
snippet info
installInstall a new snippet. 安装新的代码段。See an example.请参见示例
snippet install <snippet-name>
lsList name and version of installed snippets. 列出已安装的代码段的名称和版本。See an example请参阅示例
snippet ls
load-allLoad all installed snippets into the current environment.将所有已安装的代码段加载到当前环境中。
snippet load-all
outdatedList snippets that have updated registry versions.列出已更新注册表版本的代码段。
snippet outdated
refreshClear and refresh the snippet metadata cache. 清除并刷新代码段元数据缓存。See an example.请参见示例
snippet refresh
searchList available snippets, their version, and a brief description. 列出可用的代码段、它们的版本以及简短的描述。See an example.请参见示例
snippet search
uninstallRemove an installed snippet. 删除已安装的代码段。See an example.请参见示例
snippet uninstall <snippet-name>
updateGet the latest versions of installed snippets获取已安装片段的最新版本
snippet update