According to this, the params are:
- url (string) – connection url for MongoDB.
- [options] (object) – optional options for insert command
- callback (function) – this will be called after executing this method. The first parameter will contain the Error object if an error occured, or null otherwise. While the second parameter will contain the initialized db object or null if an error occured.
But according to this, the first two params are the same, but the params passed to the callback function are different. The second param passed to the callback is a MongoClient
instance.
Which one is correct? When I tested, the second source seems to be correct, but I wished the first was correct.