i cant execute lab questions because of validate lab1.js . I dont know how to load in CMD
What issue are you facing? Show us a snapshot
cd to the directory where this file is residing
Connect to your mongod
Then run
load(‘your_file.js’)
Search our forum threads for more examples
Like Ramachandra said you need to
- load the validateLab.js into your mongodb shell (i use mongosh)
- then create a pipeline variable and assign your aggregation pipeline to it.
- now run the validate function with your pipeline variable as a parameter. validate(pipe_line_variable)
im going off memory but should be something like that if not exactly that
1 Like