【问题标题】:How to get to the Mongo shell history file or all history on Windows如何访问 Mongo shell 历史文件或 Windows 上的所有历史记录
【发布时间】:2012-04-25 08:06:28
【问题描述】:

这在 Mac 等的 ~/.dbshel​​l 中。

【问题讨论】:

    标签: windows mongodb history interactive-shell


    【解决方案1】:

    .dbshell 会在当前目录中创建,并且没有单一的全局 .dbshell,因为它会在基于 unix 的系统下。

    TLDR:

    出于对答案的好奇,我在我的 Windows VM 上安装了 mongodb,并在安装的 bin 文件夹中运行了一些命令。我在bin 文件夹中看到了一个.dbshell,其中包含我在其中使用的所有命令。然后我去了c:\temp并给出了mongo shell的完整路径,并在那里运行了一些命令。我注意到退出后在c:\temp 中创建了.dbshell,其中包含我在该文件夹中时的命令历史记录。

    【讨论】:

      【解决方案2】:

      .dbshel​​l 文件用于某些 Mongo 版本 (2.0.x) 在目录中创建 mongo.exe 是从 shell 退出时执行的,如 lobster1234 所述。所以,它们可以分散在不同的目录中

      这在未来的版本中被修复为 USER_PROFILE env,通常是 C:\Documents and Settings\

      签到:https://github.com/mongodb/mongo/commit/6d573a9a6e2de66241be53f5eef6873ae2cc12f6

      【讨论】:

        猜你喜欢
        • 2016-08-14
        • 1970-01-01
        • 2011-06-16
        • 2022-12-18
        • 2014-06-10
        • 2019-12-24
        • 1970-01-01
        • 2011-12-11
        • 1970-01-01
        相关资源
        最近更新 更多