remove object id from the specific id 1

remove object id from the specific id

// remove ObjectId() that srownd the specific mongoDB object id
// by
_id.toString()
// or
_id.valueOf()

Here is what the above code is Doing:
1. We’re using the find() method to search for all documents in the collection.
2. We’re using the toArray() method to convert the results into an array.
3. We’re using the forEach() method to loop through the array and print each document.

Similar Posts