Run javascript script (.js file) in mongodb including another file inside js

前端 未结 5 520
攒了一身酷
攒了一身酷 2020-12-24 10:14

I want to write a long script for inserting and updating mongodb data.

  1. Is it possible to call external js file that contains the script?
  2. Is it pos
5条回答
  •  抹茶落季
    2020-12-24 10:54

    To call external file you can use :

    load ("path\file")

    Exemple: if your file.js file is on your "Documents" file (on windows OS), you can type:

    load ("C:\users\user_name\Documents\file.js")

提交回复
热议问题