Hi,
I create a script (script.js) with my pipeline and has counter = 23
var pipeline = [.....]
var counter = db.movies.aggregate(pipeline).itcount()
print(counter)
I run it in my mongo shell with this command : load(“script.js”)
Then I try to launch validateLab1.js downloaded in mongo website.
Then, in mongo shell I run : load(“validateLab1.js”)
And I has this error :
MongoDB Enterprise Cluster0-shard-0:PRIMARY> load("validateLab1.js");
2019-01-14T17:08:37.646+0100 E QUERY [thread1] SyntaxError: missing ; before
statement :
@(shell):1:1
2019-01-14T17:08:37.646+0100 E QUERY [thread1] Error: error loading js file:
validateLab1.js :
@(shell):1:1
If someone has a solution