There are two points I noted:
I performed insertMany() operation (with a typo in collection name) on “movies” collection instead of “movieDetails” and the query succeeded! …I kept looking for updates (until I refreshed the dbs in Compass)
Then, I tried to switch over to a non-existing database (could have been due to a typo) and it again succeeded.
Now, I understand the fact that mongodb creates a new instance if it doesn’t exist and that’s the reason behind it but How do I validate or check a collection/database for its existence in a particular case? If I’m inserting in a collection/database that doesn’t exist it should return an error.