updateMany Operation

After using the update many command below to update null rates and remove them. The rated field no longer appears in the documents in the Atlas, but when using the the find() function (listed last in code) the null rated counts are still 1599. Should the count be 0 now or Does the find function reports 1599 because those documents don’t contain the ‘rated’ field?

updateMany:

db.movieDetails.updateMany(
{"rated": null}, 
{$unset : {
	"rated" : ""
}});

find documents with null ‘rated’ field:

db.movieDetails.find({"rated" : null}).count()

Appreciate your help!

Please check this link

A query on null value

2 Likes