Google News
logo
MongoDB - Quiz(MCQ)
Which of the following query is used to generate a new ObjectId, use the ObjectId() constructor with no argument?
A)
x = ObjectId()
B)
x = addObjectId()
C)
x = ObjectIdAdd()
D)
None of the above

Correct Answer :   x = ObjectId()


Explanation : ObjectId() constructor is used with no argument for new object.

Advertisement