Unable to use load('validateLab1.js') command

Could you please help me as i have tried using this command but it failed although the absolute path was specified?

open cmd line then

  • cd C:\Users\changethis\Downloads\chapter1
  • mongo
  • load(‘validateLab1.js’)

thanks,that helps but still i am unable to execute the validateLab1(pipeline) command as it gives below error:
MongoDB Enterprise > load(validateLab1.js)
2018-10-23T08:50:49.624+0530 E QUERY [js] ReferenceError: validateLab1 is not defined :
@(shell):1:1
M

Hi,

As @sumancha posted, please use quotes: load('validateLab1.js')

Also make sure you start the mongo shell from the directory where you saved the validateLab1.js file.

José Carlos

Thanks its working fine.

Regards,
Muzaffar

In fact, you can use

load(‘C:\\Users\\changethis\\Downloads\\chapter1\\validateLab1.js’)