Complete the code to create a new ObjectId in MongoDB.
const id = new [1]();The ObjectId is the correct constructor to create a new unique identifier in MongoDB.
Complete the code to extract the timestamp from an ObjectId.
const timestamp = id.[1]();The getTimestamp() method returns the ObjectId's timestamp part as a JavaScript Date object.
Fix the error in the code to create an ObjectId from a hex string.
const id = new ObjectId([1]);The hex string must be passed as a string literal with quotes to the ObjectId constructor.
Fill both blanks to create an ObjectId and get its timestamp as a Date.
const id = new [1](); const time = id.[2]();
Use ObjectId to create the ID and getTimestamp() to get the timestamp as a Date.
Fill all three blanks to create an ObjectId from a hex string, convert it to a Date, and print it.
const id = new [1]([2]); const date = id.[3](); console.log(date);
Create the ObjectId with the hex string in quotes, then use getTimestamp() to get the timestamp as a Date.