Node.js Test Fiverr

The following code snippet when executed, should create a web server that serves the web page 'idx.html' from 'testing5' folder. However, the syntax of lines 3 and 4 are not correct. Select the correct replacements of lines 3 and 4 from the given answer options.
1. var exp = require ('express');
2. var serveStatic = require ('serve-static');
3. var app = express()
4. .use(serveStatic(dirname /testing5, {'index': ['idx.html']}))
5. .listen(3000);

 var app = exp()
{ use(serveStatic(__dirname /testing5,{'index': ['idx.html']}))

var app = exp()
.use(serveStatic(__dirname +'/testing5',{'index': ['idx.html']}))

var app = express();
.use(serveStatic('__dirname __testing5,{index: ['idx.html']}))

var app = express()
.use(serveStatic(/dirname +'/testing5',{index: ['idx.html']}))

var app = exp()
.use(serveStatic(__dirname /testing5, {'index': ['idx.html']}))

The following function belongs to which of the given http.Server events in Node.js:
function (request, socket, head){}

checkContinue
connection
upgrade
clientError
close

Which of the following functions is used to create an HTTPS server? (Consider the two parameters of the function as rq and rs, respectively.)

https_createServer(options(rq, rs){}).listen(3000);
https.createServer(function(rq, rs){}).listen(3000);
https.createServer(options, function(rq, rs){}).listen(3000);
https.createServer(https, options, function(rq, rs){}).listen(3000); https.createServer(function(options, rq, rs){}).listen(3000);

If you create a collection by using the createCollection method with {safe : true} option, then which of the following types of behaviors will be observed?

It will open an existing collection. If a collection does not exist, then it will return an error.
It will create a new collection if it does not exist. But if a collection already exists, then it will return an error.
It will create a new collection if it does not exist, otherwise it will return an existing collection.
It will create a new collection if it does not exist. If a collection already exists, then it will create a duplicate collection.

What will be the output of the following code snippet in Node.js?
var x = 2.4;
var y = 9;
console.log(y/x)

3
3.75
4
4.5
It will generate an error.

Which of the following operators checks whether the given field is an array and contains all the values in the given array of values or not?

$all
$in
$ne
$lte
$nin

Consider two files: first.js and second.js in a Node.js project. Content of the first.js file is given as:
module.exports = function() {
console.log('function in file first');
};
Which of the following lines of code should be written in the second.js file in order to import the function given in the first.js file to the second.js file?

require(./first);
first;

var x = require(first);
x();

var x = require(.first);
x;

var x = require('./first');
x();

A module 'rimraf' is installed locally in a Node.js project. The following code snippet is supposed to delete a directory named "Testing2" from the same project. However, the code contains some errors. Identify which code lines contain an error.
1.var rim1 = require('rimraf');
2.rimraf('./Testing2', function(error1)){
3. if(error1) console.log('This is an error', error1);
4. else console.log('Directory deleted successfully');
5.}

Lines 1 and 3
Lines 3 and 5
Lines 2 and 5
Lines 2 and 3
Lines 1 and 2

Which of the following commands is used to get out of an undesirable ellipsis: a situation in which three dots [...] are repeatedly displayed?

_break
.break
break.loop
.end
end.loop

Which of the following methods is used for setting a signed cookie? Note: Consider the function inside which the method setting is performed as: function (r, s). s.setCookie(name, value, {signed:true}) s.cookie(name, value, {signed:true}) s.setCookie(r, name, value, {signed:true}) s.cookie(r, name, value, {signed:true})
Which of the following commands in the Node debugger helps user to step out of the current executing function?

step
next
backtrace
out

This question is based on the graphic shown below.
Carefully study the code snippet given in the image and determine which of the following lines of code contain errors.

Line 1
Line 3
Line 4
Line 5
Line 6

If you generate a private key named 'key.pem', then which of the following commands will be used to generate a corresponding public key?

openssl req -x509 -new -key key.pem > cert.pem
openssl genrsa 1024 > key.mykey
openssl req -x509 -new -cert.pem-> key.pem
openssl req -new >cert.pem
openssl req -1024 -new -key key.cert > cert.pem

This question is based on the graphic shown below.
The program given in the image should create a web page with a simple label "Enter name", a text-box and a button. Initially, the text-box should display "NAME" as its content. The content of the text-box should be cleared each time the button is clicked. However, the program contains some errors. Identify which code lines contain an error.

10
11
12
14
15
21
24

Carefully study the following code snippet and answer the question that follows:
var http = require('http');
var server = http.createServer(function (request1, result1) {
console.log('This is request Header');
console.log(request1.headers);
result1.write('Working with HTTP');
result1.end();
}).listen(3000);
console.log('This is a sample');
When a client request is made, which of the following outputs is obtained on a web browser?

Working with HTTP

This is request Header

This is a sample
This is request Header

This is request Header
Working with HTTP

This is a sample

No output is displayed due to an error in the program.

What will be the output of the following Node.js code snippet?
var EventEmitter = require('events').EventEmitter;
Var er = new EVentEmitter();
var handler1 = function () {
console.log('Called the handler');
er.removeListener('example', handler1);
};
er.on('example', handler1);
er.emit('example');
er.emit('example');

Called the handler
Called the handler

Called the handler

No output will be displayed due to an error in the program

Suppose we have the following code in a Node.js file.
var path = require('path');
var completePath ='/example/test/first.html';
Which of the following lines of code should be added to the above code so that the output "first.html" is displayed?

console.log(path.filename(completePath));
console.log(path.basename(completePath));
console.log(path.extname(completePath));
console.log(path.firstname(completePath));

What will be the output of the following Node.js program?
function first (value1, value2){
console.log('First Process');
setTimeout(value2, 1000, value1);
}
function second (value1, value2){
console.log('Second Process');
setTimeout( value2, 1000, value1); }
function third (value1, value2){
console.log('Third Process');
setTimeout( value2, 1000, value1); }
function handleThird(data3){
console.log('Complete:', data3); }
function handleSecond(data2) {
third(data2, handleThird); }
function handleFirst(data1) {
third(data1, handleSecond); }
first('Process', handleThird);

First Process
Third Process
Complete: Process

First Process
Complete: Process

Third Process
Complete: Process

Second Process
Complete: Process

Second Process
Third Process
Complete: Process

Carefully study the following code snippet and answer the question that follows:
new_function (true, function (data){
func1(); });
func2();
function func1(){console.log('Clouds')}
function func2(){console.log('Sunshine')}
function new_function (ar1, ar2) {
if (ar1) {
???
}
else {
setTimeout(function () {
ar2()
}, 1000);
} }
Which of the given code lines should be written in place of '???' in the above program so that the following output is obtained?

Sunshine
Clouds

(function (){
ar2();
});

nextTick(function () {
ar1;
});

data process.nextTick(function (ar2) {
ar1();
});

process.nextTick(function () {
ar2();
});

data.nextTick(function () {
ar2;
});

This question is based on the graphic shown below.
The program given in the image should provide the following output: Fox is walking toward point A Pigeon is walking toward point B Pigeon is flying toward point C
However, lines 11 and 13 contain errors. Which of the following is the correct syntax of line 11 and line 13?

Line 11 : Animal_Example.call(this); Line 13 : Bird_Example.prototype.proto = Animal_Example.prototype;

Line 11 : Animal_Example.call(this, name); Line 13 : Bird_Example.prototype.proto = Animal_Example(prototype);

Line 11 : Animal_Example.call(this(name)); Line 13 : Bird_Example.prototype.proto__ = Animal_Example(prototype);

Line 11 : Animal_Example.call(this, name); Line 13 : Bird_Example.prototype.__proto__ = Animal_Example.prototype;

Line 11 : Animal_Example.call(this(name)); Line 13 : Bird_Example._proto_.prototype = Animal_Example.prototype;

Which of the following is the correct command that is used to check the installed version of Node.js on Windows operating system using the C command prompt?

node.js.version
version-node
node_version
node --version

This question is based on the graphic shown below.
The HTML code given in the image, when executed, should create a button and hovering over this button should display 'New Button'. Which of the following code snippets should replace '??' in the given code to obtain the desired result?

$(function()
{ button.tooltip(); });

$(function()
{ $('button').tooltip(); });

(function(
$('button').tooltip() );

$(function( { $('button').tooltip(); }));

Which of the following statements is not correct about Node.js?

Every function is asynchronous in Node.js.
Node.js has a default HTTP server.
Node.js is a JavaScript environment.
fs module is used to manage files in Node.js.

Which of the following classes is/are always used for connecting to a MongoDB server?

Db
Connection
Server
ObjectID
Handler
FileObject

What will be the output of the following program?
var name = 'John';
var dob = 15;
console.log('%s was born on %d May, 1987', name, dob)

John was born on 15 May,
1987 was born on May, 1987,John, 15
John was born on 15 May, 1987, John, 15
%s was born on %d May, 1987, John, 15
No output will be displayed due to an error in the program.

What will be the output of the following code snippet in Node.js?
var inherits = require('util').inherits;
function Parent(){
this.message ="Example ";
}
Parent.PrototyPe.exP = function(){
return this.message + "parent class " };
function Child(){Parent.call(this);}
inherits(Child, Parent);
Child.prototype.exp = funCtion () {
return Parent.prototype.exp.call(this) + "child class";
}
var chd = new Child();
console.log(chd.exp());

Example
parent class child class
parent class
Example parent class child class
Example child class
No output will be displayed due to an error in the program.

In the following program of an asynchronous test, which line of code contains an error?
Line 1: exports.aynchabc = function (abc) {
Line 2: setTimeout(function () {
Line 3: abc.equal(false, true);
Line 4: abc.done(true, false);
Line 5: } 1200);
Line 6: };

Line 2
Line 3
Line 4
Line 5

Which of the following is the correct purpose of using the 'exports' keyword in Node.js?

It is used for exporting data from one function to other.
It is used for exporting the modules.
It is used for exposing functions of one module to other modules.
It is used for exporting files from one application to other

Which of the given statements is correct about the following program?
function mSync (ar1, ar2) {
if (ar1){
ar2('Data Cached') }
else {
setTimeout(function () {
ar2('Data Loaded ')
}, 2000);
} }
mSync(true, function (value) {
prg1();
});
prg2();
function prg2(){console.log('Good Morning')}
function prg1(){console.log('Good Evening')}

It will immediately display the following output:
Good Evening
Good Morning

It will display "Good Morning" first and after two seconds, it will display "Good Evening".

It will immediately display the following output:
Good Morning
Good Evening

It will immediately display the following output:
Data Cached
Good Evening
Data Loaded
Good Morning

No output will be displayed due to an error in the program.

Which of the following methods is used for setting a signed cookie?
Note: Consider the function inside which the method setting is performed as: function (r, s).

s.setCookie(name, value, {signed:true})
s.cookie(name, value, {signed:true})
s.setCookie(r, name, value, {signed:true})
s.cookie(r, name, value, {signed:true})

Which of the following is not a part of the AAA pattern followed by good tests in chai library?

Assert
Act
Allow
Arrange

The given program should generate the following output:
The values are: [ { Value: 15 }, { Value: 8 } ]
However, the program contains some errors. Identify which code lines contain an error.
1) function addValue(val1, val2) {
2) setTimeout(function(){
3) val2(null, {Value: val1});
4) }, 500);
5) }
6) function valuesLoaded (loadedValues){
7) console.log('The values are:', loadedValues);
8) }
9) var a = require(Async);
10) a.parallel([function(val) {
11) addValue(15, val);
12) },
13) function(val) {
14) addValue(val, 8);
15) }
16) ],valuesLoaded)

3
6
9
10
11
14
16

Which of the following is the correct command for installing the NPM module, underscore?

node npm underscore install
npm underscore
install install npm underscore
npm install underscore

In Node.js, which of the following keywords is used to load a module?

listen
load
require
log
res

Which of the following is the correct program code that repeatedly calls a function after every two seconds for continuous eight seconds, and after that clears the interval with the message 'Loop ends' and exits the application?

var obj1 =setInterval(function(2000) { var count = 0; count++; console.log(count, '2 seconds has passed'); if(count == 4) { console.log('Loop ends'); clearInterval(obj1); } });

var obj1 =setInterval(functIon() { var count = 0; count++; console.log(count, '2 seconds has passed'); if(count == 4) { console.log('Loop ends'); clearInterval(obj1); } },2000);

var count = 0; var obj1 =setInterval(function() { count++; console.log(count, '2 seconds has passed'); if(count == 4) { console.log('Loop ends'); clearInterval(obj1); } },2000);

var count = 0; var obj1 =(function.setInterval() { count++; console.log(count, '2 seconds has passed'); if(count == 4) { console.log('Loop ends'); clearInterval(obj1); }, 2000 });

Carefully study the following code snippet and answer the question that follows.
var exp = require('express');
var application1 = exp() .use(function (rq, rs){
console.log('Cookie Header:\n', rq.headers['cookie']);
rs.cookie('\n name', 'Node.js');
rs.end('Hello Express World');
}).listen(3000);

Hello Express World

Hello Express World
Cookie Header:"Your cookie header name"; Name=Node.js

Cookie Header:"Your cookie header name"; Name=Node.js

No output will be displayed on the server console.

Name=Node.js

In Node.js, which of the following functions is used by an Express app to accept the middleware?

param
use
put
get

In Node.js, which of the following modules use(s) the 'require' function?
1)  Core module
2)  File module
3)  External node_modules

Only 2
Only 1 and 2
Only 1 and 3
Only 2 and 3
All 1, 2, and 3

What output will be generated on the execution of the following code snippet in Node.js?
function Test()
{}
console.log(Test.prototype.constructor === Test);

true
false
Test
No output will be displayed due to an error in the program.

In Angular.js, which of the following acts as a link between the view and the model and is passed to the controller?

ng-controller
ng-app
guideService
$scope

Carefully study the given code that is calling the loadJSON method and answer the question that follows.

loadJSON('new.json', function (err, data)
{ if(err)console.log('Error in file reading', err.message);
else
console.log(data);
});

Which of the following is the correct function definition of the loadJSON method such that if a file named "neW.json" is present in the project, then its data is displayed, otherwise error message (error in file reading) is displayed?

function loadJSON(file_name, arg){
file1.readFile(file_name, function(error1, data){
if(error1)return arg();
try{
arg(null, JSON.parse(data)); }
catch(error1) {
return arg(error1);
}
return arg(null);
}); }

function loadJSON(file_name, arg){
file1.readFile(file_name, function(error1, data){
if(error1)return arg(error1);
try{
var new_parse =JSON.parse(); }
catch(error1) {
return arg(error1); }
return arg(new_parse);
}); }

var file1 = require('fs');
function loadJSON(file_name, arg){
file1.readFile(file_name, function(error1, data){
if(error1)return arg(error1);
try{
var new_parse =JSON.parse(data); }
catch(error1) {
return arg(error1); }
return arg(null, new_parse);
}); }

function loadJSON(file_name, arg){
fs.readFile(file_name, function(error1, data){
if(error1){
try{
arg(null, JSON.parse(data));
}
catch(error1) {
arg(file_name);
} }
}); }

What will be the output of the following code snippet?
var x =[8, 12, 3];
x.push(5);
x.unshift(1);
console.log(x[0]);

8
3
1
5
It will generate an error.

What will be the correct output of the following function?
process.nextTick(function(){
console.log('Example')
});
console.log('Hello');
console.log('World');

Example
Hello
World

Hello
World
Example

Hello
World

Example

The program will throw an error.

Which of the following is a valid JSON object in Node.js?

 {
phoneinfo :
{type: home, number : 123456},
{type : mobile, number : 8888888},
}

 {
phoneinfo : {
{type = home, number = 123456},
{type = mobile, number = 8888888}
}}

 {
phoneinfo : [
{ type : home, number : 123456},
{type : mobile, number : 8888888}
]}

{
phoneinfo : {
type : home, number : 123456,
type : mobile, number : 8888888
}}

State if true or false.
In node.js, applications are processed asynchronously on a single thread.

True
False

Which of the following is the correct function of the ng-repeat directive?

It takes the DOM element it is defined on and duplicates it for every element in the ViewModel list.
It replicates the occurrences of a script element within different functions.
It takes the function it is defined on and duplicates it for every element in the ViewModel list.
It replicates the occurrences of a controller within different functions.

Which of the following statements is/are correct about working with the MongoDB server and the Mongodb module?

The {w : 0} flag is passed to the database constructor that tells to wait until at least one confirmed write has succeeded.

A new Db object is required to be created for each incoming request to the application server.

The Mongodb module allows multiple people to work with the database server at the same time.

The value of the pool size parameter to the Server object constructor is adjusted for choosing the number of connections to be maintained for the MongoDB server.

What will be the output of the following code snippet?
var myVar = 'First Value';
if (true) {
(function () {
var myVar ='Second Value'
})();
}
console.log(myVar);

First Value

Second Value

First Value
Second Value

Program compiles successfully but nothing is displayed as output.

No output will be displayed due to an error in the program.

Carefully read the following code:
1. var EventEmitter = require('events').EventEmitter;
2. var example = new EventEmitter();
3. example.on('data', function sample1(){});
4. example.on('data', function sample2(){});
5. console.log(???);
Which of the given options should replace ??? in line 5 of the above-given code snippet to obtain the following output?
[ [Function: sample1], [Function: sample2] ]

example.listeners('data')
listener(example.data)
example.listeners.data
listener, example('data')

Observe the following code carefully:
var file1 = require('file');
file1.writeFileSync('first.txt', 'File System Introduction');
console.log(file1.readFileSync('first.txt').toString());
The given code should create a text file named "first.txt" and display the output "File System Introduction". However, the program contains an error. Identify which of the following lines of code contains an error.

Line 1
Line 2
Line 3
There is no error in the program.

Which of the following testing assertions uses the operator === for testing equality?

deepEqual(value, expected)
strictEqual(value, expected)
ok(value)
throws(code, [error])

What is the default port number on which a node process in debug mode listens for accepting the incoming connections for the purpose of debugging?

3000
5858
8080
3333

Which of the following statements are NOT true about promises in Node.js?

Promises provide a significant feature of chain-ability.
In promises, the onRejected handler is called only once while the onFulfilled handler can be called multiple times.
Promises can support other promises as a value.
Promises suffer from the maybe sync problem of callbacks.

Choose True or False.
In MongoDB, it is possible to insert two values with same_id values into a collection.

True
False

Which of the following command line arguments can be used to convert a file named "base3.js" into an AMD module?

 browserify amdmodule -o base3.js
amdmodule.js browserify base3.js -o
amdmodule browserify -o base3.js
browserify base3.js -o amdmodule.js

Which of the following is/are not (a) valid state(s) of promise used in Node.js?

Settled
Pending
Fulfilled
Sleeping
Rejected

Which of the following are the advantages of node_module?
a)  It increases reusability.
b)  It simplifies the long file relative paths.
c)  It helps in overcoming module incompatibility.
d)  It is very helpful in changing of URLs without updating the middleware.
e)  It allows to check the class of a particular object instance.

Only b and c
Only a and d
Only a, c, and d
Only a, b, and c
Only b, d, and e

Choose True or False:
Angular.js uses two-way data-binding for attaining synchronization between the view and the model.

True
False

The given program should generate the following output:
{ value1: 2222, value2: { x: 'hello World!', y: 8888 } }
However, the program contains errors. Identify which of the given lines of code contain errors.
Program
1. var firstvar = {
2. value1: 2222,
3. value2: {
4. x:'hello World!'
5. y: 8888
6. };
7. };
8. console.log(firstvar);

Line 1
Line 2
Line 4
Line 5
Line 6
Line 7

A Node.js project consists of three files: app1.js, app2.js, and app3.js. The code snippets of each of these files are given below. If we execute app2.js, then what output will be obtained?app1.js
module.exports = {
value1: 'Hello'
}
app2.js
var app1 = require('./app1');
console.log('Initial value:',app1.value1);
app1.value1 = 'World';
var app3 = require('./app3');
app3.js
var app3 = require('./app2');
console.log('Final value:', app3.value1);

Initial value: Hello
Final value: Hello

Initial value: Hello
Final value: World

Initial value: Hello
Final value: undefined

Initial value: Hello

No output will be displayed due to an error in the program.

Which of the following HTTP methods for collection URLs is used to replace the entire collection with a new collection?

GET
PARAM

ALL

PUT

POST

The following program was designed to create an Express app that displays the output "Working with Express" on the web browser. But the program contains some errors. Identify which code lines contain an error.
1) var exp1= require('express');
2) var http= require('http');
3) var newapp = exp1()
4) use(function(req, res, next) {
5) res.end('Working with Express');
6) });
7) https.createServer(newapp).listen(3000);

Line 3
Line 4
Line 5
Line 6
Line 7

Study the following code snippet and determine which code line contains an error.
1. var connect =require('connect'),
2. http = require('http');
3. var app = connect();
4. http.createServer(http).listen(3000);
5. console.log('port 3000');

Line 1
Line 2
Line 3
Line 4
Line 5

A Node.js application consists of an HTML file named 'idx.html' and a JavaScript file 'ht3.js'. The file ht3.js when executed, should display the content of 'idx.html' file on the web browser. However, the file 'ht3.js' contains some errors. Identify which code lines contain an error.
1. var http = require('http');
2. var fs;
3. function send404(response){
4. response.writeHead(404, {'Content-Type' :'text/plain'});
5. response.write('Error 404: Resource not found');
6. response.end();
7. }
8. var server =http.createServer(function(req, res){
9. if(req.method = 'GET', req.url ='/'){
10. res.writeHead(200, {'content-type' : 'text/html'});
11. fs.createReadStream('idx.html')
12. }
13. else{
14. send404(res);
15. }
16. }).listen(3000);
17. console.log('server running on port 3000');

2
4
8
9
10
11
14
16

What is the purpose of using URL hashes in Node.js?

 URL hashes are used to call a function that is present in one page of a web application to another page of the same web application.
URL hashes are used to link two different web applications.
URL hashes are used to denote that different content is being displayed in a web application that consists of a single page.
URL hashes are used to combine two or more web pages in a single page in a web application.

The following code snippet should provide the output '[125, 450, 80]'. However, line 3 contains an error. What should be the correct syntax of line 3?
1)var m1 = [5, 10, 35, 125, 450, 80, 40];
2)var _ = require('underscore');
3)var output = _(m1, function (val1) 4){
5) return val1 >50
6)});
7)console.log(output);

var output = _.filter(m1, function (val1){
var output = filter._(m1, function (val1){
var output = filter(m1, function (val1){
var output = _(filter(m1, function (val1)){

Which of the following is the purpose of installing the NPM module, optimist?

It exports an object that creates a global variable '_'.
It exports an object that contains the parsed command line argument in the form of argv property
It exports a large number of open source Node.js packages.
It exports mathematical functions to the application.

Which of the following is/are true about the http.ServerResponse object in Node.js?
1.  It is created by an HTTP server.
2.  It is passed as first parameter to the 'request' event.
3.  It is a writable stream.

Only 1
Only 2
Only 2 and 3
Only 1 and 3
All 1, 2, and 3

Carefully study the following Node.js code snippet and answer the question that follows.
1.  var var1 = {
2.  x : 50,
3.  y :"This is a string",
4.  z : false
5.  };
6.  var json_example = stringify.JSON(var1);
7.  console.log(json_example);
8.  console.log(typeof json_example );
9.  var json_example1 = JSON.parse(var1);
10.  console.log(json_example1);
11.  console.log(json_example1.y);
Which of the following lines of code contain an error?

Line 4
Line 5
Line 6
Line 8
Line 9
Line 11

In a Node.js application, the 'optimist' module is installed. If the following program is executed in a JavaScript file of this application, then what will be the output?
var a1 = require('optimist').argv;
delete a1['$0'];
console.log(a1);

{ _: [], :'node/path to your app.js'}
{ _: [] }
{[]}
No output will be displayed due to an error in the program.

This question is based on the graphic shown below.
The program given in the image should provide the following output:
Fox is walking toward point A
Pigeon is walking toward point B
Pigeon is flying toward point C
However, lines 11 and 13 contain errors. Which of the following is the correct syntax of line 11 and line 13?

Line 11 : Animal_Example.call(this);
Line 13 : Bird_Example.prototype.proto = Animal_Example.prototype;

Line 11 : Animal_Example.call(this, name);
Line 13 : Bird_Example.prototype.proto = Animal_Example(prototype);

Line 11 : Animal_Example.call(this(name));
Line 13 : Bird_Example.prototype.proto__ = Animal_Example(prototype);

Line 11 : Animal_Example.call(this, name);
Line 13 : Bird_Example.prototype.__proto__ = Animal_Example.prototype;

Line 11 : Animal_Example.call(this(name));
Line 13 : Bird_Example._proto_.prototype = Animal_Example.prototype;

Which two of the following statements will generate the output "Hello Node.js"?

Console.log("Hello Node.js");
console.log('Hello Node.js');
console.log("Hello Node.js");
Console.log('Hello Node.js');
console.Log('Hello World');

Which of the following code snippets should be added at the top of those files that use the mongodb module?

Var Db = require('Db'),
Connection = require('Connection'),
Server = require('Server);

Var Db = require('mongodb'),
Connection = require('mongodb'),
Server = require('mongodb').listen(3000);

Var Db = require('Db').mongodb,
Connection = require('Connection').mongodb,
Server = require('Server').mongodb;

Var Db = require('mongodb').Db,
Connection = require('mongodb').Connection,
Server = require('mongodb').Server;

Node.js Test Fiverr 2020