发布于 2015-09-14 15:12:38 | 84 次阅读 | 评论: 0 | 来源: 网络整理

load("file")
Para string file:
 Specify a path and file name containing JavaScript.

This native function loads and runs a JavaScript file into the current shell environment. To run JavaScript with the mongo shell, you can either:

  • use the “--eval” option when invoking the shell to evaluate a small amount of JavaScript code, or
  • specify a file name with “mongo”. mongo will execute the script and then exit. Add the --shell option to return to the shell after running the command.

Specify files loaded with the load() function in relative terms to the current directory of the mongo shell session. Check the current directory using the “pwd()” function.

最新网友评论  共有(0)条评论 发布评论 返回顶部

Copyright © 2007-2017 PHPERZ.COM All Rights Reserved   冀ICP备14009818号  版权声明  广告服务