Saturday, September 20, 2014

MongoDB CRUD Operations

       MongoDB CRUD stands for Create, Read, Update, Delete. MongoDB provides rich semantic to communicate with the database. MongoDB CRUD operations are much similar to SQL create,select,update and delete operations. If you already work with SQL you will find it very easy to understand and if your not then still you will find it very easy! OK, before moving forward to CRUD operation we have to understand how MongoDB stores data. As we know MongoDB is document oriented database it stores the data in the form of documents.
      So no rows and columns. It uses JSON(JavaScript Object Notation) like format to store data. Formally, MongoDB documents are BSON documents. BSON is a binary representation of JSON with additional type information. following image is example of MongoDB document.

     Above document shows fields and values which is much similar to the relational database table but MongoBD uses dynamic schema means you not need to specify datatype, fields before entering data into database such as relational database management system. Following image is example of tabular database.
 In MongoDB there are collections instead of table. In MongoDB database contains number of collections MongoDB stores all the documents in collection. Collection is a group of related documents that have a set of shared common indexes.

Now lets see MongoDB CRUD operations, Mainly include MongoDB read operation and Write operation. It contains some important points such as Cursor, query optimization and distributed queries but we will perform simple operations first for better understanding.
    We will perform the tasks in following order :
  1. Create 
  2. Insert 
  3. Read 
  4. Update 
  5. remove
       Before start performing this operations we have to setup environment means making connection between "mongod" server and "mongo" client. If you don't know how to startup mongo shell then read my previous blog "Downloading and installing MongoDB on windows" 

1. Create:
   lets start from creating database in MongoDB. Now what you have to do is just enter following command on mongo shell,
          use databasename
        use blogdata 
   Database is not created unless you not inserting documents in it.

2. Insert:
     To write into database following syntax is used,
             db.collectionname.insert({ document to be inserted});

      You can use any other folder name instead of "db" if you want.You don't have to create collection separately. It will automatically get created.

        To see the document that you have inserted run this command "db.collectionname.find()", "collectionname" should be the same which you have used earlier to insert document.

  3. Read:
           To read data from the database following command is used,
    By using this command documents will get displayed, you can be more specific by writing some criteria in find(), by default it will display all documents that contains in collection. But if you want to get specific document then Mongo provides way to write more optimized query you can use :

  • Limit the cursor means you can limit the number of result you get which matches criteria.
  • Can add projections means you can specify which fields you want in result.
  • Can add query criteria 

     This query returns documents in which age is greater than 18. It will display only name and address field because it is specified as "1" if field is "0" then mongo does not display that fields in result. Look at following SQL query which gives same result as mongo query for more better understanding.

    4. Update: 
           Update operation is used to modify the documents,
                  db.collectionname.update({ criteria})
            Following query will update the document field "status" as "A" where field "age" has value greater than "18".

     Following SQL query gives the same result as mongo.

   5. Remove: 
        Remove operation is used  to delete documents from database,
         Following query will remove the documents where "status" field is "D".

   See the SQL query for same operation, 

Sunday, September 14, 2014

Learn how to hack hathway internet on your windows xp/7/8/8.1

Learn how to hack hathway internet on your windows

Welcome all to our blog of itsitrc, this article is for learning the hack for internet access or it can be used to share the internet of same account. Hacking is not good but using it for some useful purpose can propose a way to use and share efficiently. Use following information study purposes, if you get caught in doing such activity you may go through Cyber law, so this article is not responsible for your activity.

Let’s start with the Procedure:

Learn how to change MAC address in windows 8 and Windows 8.1

Learn how to change MAC address in windows 8 and Windows 8.1

MAC address is combination of Hexadecimal values:

Just follow the below pictorial directions and you will be through:

1. Go to Control Panel.

Monday, September 8, 2014

Learn How to set router wifi access with password protected of iball baton router

Hello all, this article is for iball Router internet access configuration setup tutorial for iball baton router. This setting is not so difficult as we will cover it using pictorial views with descriptive headings. So, lets start with it.

Let me discuss you with some basics about router. If you want to enable a wired internet to WIFI internet , you need to connect the incoming internet cable to 1st port of your router. 

About Router:

Friday, September 5, 2014

Downloading and installing MongoDB on windows

        Downloading and installing MongoDB is very simple and easy. Before you download MongoDB for your Windows you should know which version of Windows you’re using and to run MongoDB on your system also make sure that you’re using windows newer version than Windows XP.
    To check which version of Windows your using enter following command in terminal:-
wmic os get osarchitecture
It will show your windows architecture as shown in below image:-

Downloading and installing MongoDB involves following three steps:-
1.     Download zip file
2.     Extract the file
3.     Setup the environment 

Introduction to MongoDB

     MongoDB is new generation document oriented NoSQL database. It is open source product and developed and supported by company 10gen (Now Mongo Inc.). MongoDB is available under GNU Affero General Public License and Apache License. 10gen created MongoDB in 2007 and its first product release was MongoDB 1.4 in 2009.

       Its definition given by 10gen:- “MongoDB is a scalable, open source, high performance, document oriented database.” 
            MongoDB is most popular document oriented NoSQL databases now days. To know more about NoSQL database and its categories read my previous blogs.
MongoDB is adopted by many mejor companies including eBay, The New York Times, CERN, SAP, MetLife, MTV, Forbes, Sourceforge, Codecademy, Shutterfly, Foursquare and more.

 MongoDB provides following features:-
  • Ad hoc queries:- It supports search by field and regular expression search.
  • Indexing:- Any field in mongodb can be indexed.
  • Replication:- Supports master-slave replication. A master can perform           read-write and a slave copies data from the master and can only be used          for read or backup.
  •  Duplication of data:-Data duplication to keep the system up and running     in case of hardware failure.
  •  Scalability:- New machines can be added to run a database.
  •  Automatic Load Balancing:- Data is split into range and shared across        multiple nodes.
  • File storage:- Could be used as a file system taking advantage of load balancing and data replication.
  •  Aggregation:-MapReduce is available. Offers similar functionality as SQL GROUP by clause. 
  •  JavaScript execution:-Can use JavaScript functions.
  • Special support for location:- Understands longitude and latitude.

Wednesday, September 3, 2014

Greenify Your Android.

Many of the Android phone users have the problem of battery life not lasting over about 6 hours of the day. The main culprit behind this problem is a lot of processes running in the background. Many of you would have observed that as you install more and more applications on your device, the phone becomes slow and battery life becomes very less. This is because nearly each application that you install has a background service that keeps running continuously on your device. Developer Oasis Feng has come out with a solution for this problem.

Tuesday, September 2, 2014

Linux Ingredients

My today’s blog is for those readers who are newbie to Linux Operating system. This blog will help you to know what all the Linux OS consists of.

 Fig1: TUX

Now say, for an instance you want to cook a dish. In order to cook that dish you need to know the recipe of that dish. In the same way my today’s blog is about the ingredients that make up Linux OS. Linux contain the Grub boot loader, Bash shell, GNU shell utilities, daemons, graphical server, a desktop environment, and more. These programs are developed by different, independent development groups.

So let’s start. Following names mentioned before the colon is the name which I have given and which is mapped into our daily life.

The Supporters: Daemons

These are the background processes. They start at booting process, so they’re one of the next things that loads after the kernel and before you see your graphical login screen. For example, CRON-D manages the scheduled tasks, which is a daemon; d at the end stands for “daemon.” syslogd is another daemon that traditionally manages system log. 
Fig 2: Linux Daemon

The Heart: Boot loader

When our PC is turned “ON”, our computer’s BIOS or UEFI firmware loads the software from our boot device. It is the first program that loads with any operating system. For Linux, it is called as Grub boot loader. For multiple OS, we are provided the choices to select our desire OS. 
Fig 3: Grub Boot Loader

The Slate: Shell

Linux provides various shells. Most Linux systems use the Bash shell by default. Various other shells are C-shell, Korne shell, Borne shell. Shell provides a command processor interface, and allows controlling computer by typing commands at a text interface. Shells are used to run shell scripts.
 Fig 4: Linux-terminal-bash-shell

The Central Core: Linux Kernel

The precise piece of software Grub boots is the Linux kernel. The kernel is the core of the system. It is responsible for managing CPU, memory, and input/output devices like keyboard, mice, and displays.

The Value addition: Shell utilities

The shell provides some basic built-in commands; For example, commands as critical as the cp command for copying a file, ls command for listing files in a directory, and rm command for deleting files are part of the GNU Core Utilities package.

The Most User Friendly Thing: Graphical Desktop

Desktop of Linux is very user friendly and is same as the desktop of window. They include their own utilities built to fit in with the desktop environment as a whole, like GNOME and Unity include the Nautilus file manager developed as a part of GNOME, whereas KDE includes the Dolphin file manager developed as a part of the KDE project.
Fig5: Desktop Environment
Thus this all are the key ingredients of the Linux OS. Now I am very sure that if asked, that what all Linux OS consist of then, all my readers will be able to answer it.