gpt4 book ai didi

mongodb - 配置/增加 MongoDB shell 历史长度

转载 作者:可可西里 更新时间:2023-11-01 09:57:04 25 4
gpt4 key购买 nike

我想查看 MongoDB shell 历史记录。我在谷歌上搜索然后我发现所有的 shell 历史记录都存储在 .dbshel​​l 文件中。

1) 在 MongoDB Shell 中查看 MongoDB Shell 历史是否有任何命令或技巧?

2) 默认的 MongoDB shell 历史记录长度是多少???

3) 如何配置/增加 MongoDB shell 历史长度??

最佳答案

1) Is there any command or tricky way to see MongoDB Shell history in MongoDB Shell??

我不知道 mongo shell 助手可以查看完整的历史记录,但是您可以使用 cat(),例如:

cat("/Users/myhomedir/.dbshell")

还有键盘快捷键:

  • 向上箭头 - 上一个历史记录项
  • 向下箭头 - 下一个历史记录项
  • Ctrl+R - 反向搜索历史
  • Ctrl+S - 向前搜索历史

2) What is default MongoDB shell history length???

100 件(引用:linenoise.cpp)

3) How to configure/increase MongoDB shell history length??

在 MongoDB 2.6 中,这是硬编码的。您可能会更改源代码并重新编译,但这对于一个小功能来说需要付出很多努力。

你应该投票/观看 SERVER-8417: Allow setting of shell history length在 MongoDB 问题跟踪器中。

关于mongodb - 配置/增加 MongoDB shell 历史长度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25322152/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com