# Driver Basics

Driver Basics: Connecting from Node: MongoClient and the Connection String, From mongosh to the Driver: find, insertOne and toArray.

Updated: November 19, 2026

1. [Connecting from Node: MongoClient and the Connection String](https://www.ask-codey.com/lessons/mongodb-driver-connecting-from-node) (Journeyman): The official mongodb package connects a Node app to MongoDB through a MongoClient made from a connection string, which lives in a .env file that Node reads with --env-file, and the app connects that one client when it starts and closes it when it stops.
2. [From mongosh to the Driver: find, insertOne and toArray](https://www.ask-codey.com/lessons/mongodb-driver-from-mongosh-to-the-driver) (Journeyman): Every mongosh query has a twin in the Node.js driver, written with db.collection("pets"), await, a projection inside an options object, toArray() to read a cursor, and new ObjectId(id) imported from the driver, and insertOne gives back the new document's insertedId.

Source: https://www.ask-codey.com/courses/mongodb-in-depth/topics/mongodb-driver-basics
