Command Prompt Tutorial

Commands (Cont. 2 )


  •  You can even declare variables which may contain whole set of data.



  •  Now after defining the variable “doc”, we have to save it explicitly, by applying the save command over the data collection.



  •  Now, if you want to fetch a particular document from the collection, then use its index number. For instance:-



  •  You can use a variable to assign value to some other document.





  •   Indexing in mongoDB
           db.collection_name.ensureIndex({key:1});
           
here key is the file on which we want to perform the indexing and 1 represents ascending order and -1 represents descending order.




Command Prompt Tutorial


Commands (Cont. 1 )

You can check the no. of documents in a collection by using
> db.data.count()



Lets insert some documents into the collection "data", we have created
Just to clarify, our database name is data and our collection name is also data. 

( I should have used a different name for collection...my apologies...)


Syntax is:

db.collection_name.insert({"field":"value"});


>db.data.insert();

This is empty, which we have created.

So, lets insert some name

>db.data.insert({“name”:”abc”});

We can also specify multiple values for a single attribute.

>db.data.insert({“name”:”abc”,”ph”:[123,456]});



To check your documents in a collection, use the following command

>db.collection_name.find();




The unique ID above is generated based on the machine and current time. 
So, the combination of all these components makes a perfect unique key.









How to remove one OS from multiple OS list? Dual Boot

How to delete one OS from Dual Boot Partition


ALWAYS BACKUPS YOUR FILES.

If you are using Windows, then go through the following steps:-

Click Windows+R
Type cmd
In cmd type diskmgmt


Select the partition you created for the Windows you want to remove. Example:- If you want to remove Windows 8 then, check which local drive have windows 8 installed
Right click over that partition and click 'Format'
A Warning dialog will pop up, click OK to continue.

Inside the dialog,select NTFS as the File System option
The formatting process will now begin.
Once complete, the drive will be displayed as a ‘Logical Drive’ in Disk Management.

Right click the ‘Logical Drive’ in Disk Management, on the contextual menu, click the ‘Delete Volume’ option. Click ‘Yes’ when the warning dialog pops up.
The Volume you deleted will now appear as ‘Free space’. 
Right click it and delete the volume.

The volume will become Unallocated.
Then merge up that uncallocated area by clicking on any other partition, right clicking it, and then click on extend volume.

This unallocated volume will merge up with the 2nd partition you chose.