Now to shamelessly plug my driver. It can be downloaded via npm, or fetched from the github repository. To install via npm, do the following:
npm install mongodb
or go fetch it from github at https://github.com/mongodb/node-mongodb-native
Once this business is taken care of, let’s move through the types available for the driver and then how to connect to your Mongo DB instance before facing the usage of some CRUD operations.
Mongo DB data types
- Double class a special class representing a float value, this is especially useful when using capped collections where you need to ensure your values are always floats.
- Long class a special class that lets you store 64 bit integers and also lets you operate on the 64 bit integers.
- Binary class a special class that lets you store data in Mongo DB
- ObjectID class a special class that holds a MongoDB document identifier (the equivalent to a Primary key)
- DbRef class a special class that lets you include a reference in a document pointing to another object