4/29/2023 0 Comments Ultraedit v20![]() UltraEdit is configured by default to open all files in same instance. It looks like mongo determines file change not by watching the file status (file size, file dates, file attributes) of the file passed to the called editor, but the execution state of the called editor application. My answer is an addition on what Stennie wrote already above which was too long to add it as a comment. With the "separate process" setting enabled, you should now be able to use UltraEdit as an external EDITOR and see the changes reflected when you close the editing tab opened from the mongo shell. Restart UltraEdit (the setting doesn't appear to take effect until the next launch).Under Application Layout > Miscellaneous enable the checkbox for the setting Maintain separate process for each file opened from external application.Open the Configuration settings ( Advanced > Configuration menu).UltraEdit saves the JS file, but apparently doesn't return the expected exit code so the mongo shell is unaware that the JS file has been updated and should be reloaded.ĮDIT: Thanks to UltraEdit Expert's suggestions, I found a configuration setting that makes UltraEdit work nicely: The edit command from the mongo shell will open a new tab, but when you close this tab (to save changes) UltraEdit prompts with a "Save as" dialog. (doesn't work) if UltraEdit was already open and has other document tabs, it has different behaviour. UltraEdit prompts to save the updated JS file in the same location. You should be able to successfully use edit from the mongo shell to launch UltraEdit, edit a variable, and see the results saved when you close UltraEdit. (works with luck) if you don't have UltraEdit open before you invoke edit from the mongo shell and don't open any extra tabs, it will work as an external editor. UltraEdit has some extra user experience wrinkles (I tested with UltraEdit V20): You can use load("/path/to/file.js") to reload the latest version of a JS file into the shell. If you are developing complex JavaScript functions, you probably want to have those in an external file. While notepad.exe works, there is likely a more capable editor that includes JavaScript syntax highlighting. ![]() Limit yourself to using a single document editor for your EDITOR setting. The external editor doesn't return the expected 0 (no errors) return code The external editor has a multiple-document interface and there are already other documents open The shell session then waits for the editor to exit and checks the return code. When you use the edit command, the mongo shell writes a temporary JavaScript file with the contents of that variable and launches the external editor with this file path. The EDITOR environment variable works on Windows, but it looks like there are a few factors that affect usability as at MongoDB 2.4.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |