db.colleciton.find({})
- Find all docs in collection
db.collection.find({}).pretty()
- Pretty print all docs in collection
db.collection.find({}).count()
- Return the number of docs in collection
The storage engine is directly responsible for Data file format and ithe format of indexes. Storage engine dos not affect the API that the programmer uses, nor does it have anything to do with inter server communication on replica sets.
When dealing with code, you often come across something about asyncronous and syncronous streams.
Imagine you go to McDonals and you order a Big Mac, in a syncronous world, no one else can place an order until your Big Mac has been cooked, bagged up and delivered to you. In an async world, when you order the Big Mac, the order is sent to some other people who cook it and bag it, whilst the guy who took your order can continue to serve other customers.
When dealing with JavaScript we often need to do things in order, to make it predictable and bug free. We also need to wait for something to happen before proceeding.
A library
or a package
is simply a collection of functions that someone has written and has made avaiable to the public either for free (open source) or by selling it. They may even be written by you!
Examples of libraries are:
A variable allows you to store some value in a easy to remember name so that you can retrive the stored value.
For instance if I wanted to make a program that dealt with money, then having a variable called 'balance' is easier than constantly writting out my current balance in numbers. This also gives us the advantage of updating the variable in one location, and having it update everywhere.
Consider the following:
// My balance is 10.00