2013-02-21 32 views

回答

4

老實說,我無法找到其與Windows連接的限制,除了:

Makefile
  • * nix的特定

    檢查_isWindows()我已經使用了相當長的時間蒙戈數據庫在* nix和Windows中,唯一的區別是我在Win版本中缺少​​參數。

    所以我會嘗試做(在Win7 FE):

    • 刪除_isWindows()
    • 開始蒙戈終端上的一些測試DB與--shell命令,只是這個

    mongo localhost/test --shell mongo_hacker_custom.js

    然後,如果一切工作正常,您可以填寫~/.mongorc.jsmongo_hacker_custom.js內容,而不創建符號鏈接(BTW,從Vista開始Windows也支持它們,所以符號鏈接也是合適的)。

    P.S.現在我不能嘗試這個解決方案,我自己會在幾個小時內檢查建議的解決方案。

    UPD:葉氏,它似乎是工作就好了我的Windows 7 + MongoDB的2.2.1

  • +0

    嗯,我試過了,輸出着色不工作對我來說,它會爲你嗎? – Restuta 2013-02-21 22:07:32

    +0

    沒有,着色不​​爲我工作,但我在測試它的方法,傭工,並且也表明了我的一些元信息,如服務器/數據庫 – n1ckolas 2013-02-21 22:11:25

    +0

    是啊,這工作,我可能會派生它並擴展爲Windows。 – Restuta 2013-02-21 22:19:09

    0

    該行的唯一原因是由於ANSI着色在Windows終端/ CMD不工作窗口(Esc字符得到輸出,而不是解釋)。

    禁用着色(有幾種方法,但清空'常量'或NOPing低級別的調用,一切都結束了調用這兩個工作),並刪除檢查的Windows可以使用它。

    你的另一種方法是至少工作screen作爲輸出顏色下運行它有(但不提示的顏色出於某種原因)。

    2
     
    mongo-hacker does work on windows but a little work is required : 
    
    ----------------------------------- 
    1) Make your own mongo configuration file (.mongorc.js) 
    ----------------------------------- 
        This is located in your documents : 
        %USERPROFILE%\.mongorc.js 
        eg. C:\Users\Olivier\.mongorc.js 
    
        A) Make all files from mongo-hacker into one big JS file. 
        ----------------------------------- 
    
        A.1. If you have cygwin (or some unix emulation tools) : 
        There might be a better way to achieve this but this will work. 
        Once the .zip file is unzipped, and your are in \mongo-hacker-master\hacks 
    
         find ./ -type f -name "*.js" | xargs cat > .mongorc.js 
    
        You can then move this file to your documents. 
    
        A.2. Else : 
        Or, if more convenient here is my version (v 0.0.4 at the time of writting) : 
        Download : .mongorc.js example for windows 
        And copy this file in your documents. 
    
    ----------------------------------- 
    2) Get the coloring working : 
    ----------------------------------- 
    
        A) Download : ansicon 
        ----------------------------------- 
        This processes ANSI escape sequences for Windows console programs. 
    
        B) Add this to your windows path 
        ----------------------------------- 
        To get there : 
        > Click on start menu 
        > Right click on computer 
        > Properties 
        > Advanced system settings 
        > Environment variables 
        Once there, in the 2nd section (system variables) : 
        You will see variable : 
        Path 
        > Click on its value, and add the path to the ansicon.exe program, eg : 
    C:\Program Files\ansicon\x64; 
    
        C) Then 
        ----------------------------------- 
        You can now prefix your command with ansicon to get the coloring working : eg : 
    
        $ ansicon.exe mongodb 
    

    You can now enjoy a much nicer user interface, even on windows ;

     
    ----------------------------------- 
    3) Get a proper shell 
    ----------------------------------- 
        The out of the box windows shell (cmd.exe), being what it's, 
        I'd really recommand that you get a proper shell. 
        For example : console is a very nice program. 
    
        I hope this helps !