Command Prompt Tutorial

Commands (Cont. 3 )


  •  Searching using the findOne()
    We can search for a particular attribute of a document using the findOne().


  • Drop a collection




  • To find the available collections in the current db
- show collections

  This print out the list of collections. We can also show tables


- show db.getCollectionNames()

  This returns the collection names as an array.



Next >

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.

Oculus Rift...

  • It is a new virtual reality (VR) headset designed specifically for video games that will change the way you think about gaming forever.
  • With an incredibly wide field of view, high resolution display, and ultra-low latency head tracking, the Rift provides a truly immersive experience that allows you to step inside your favorite game and explore new worlds like never before.
  • Video tech startup "Condition One" is currently working on a documentary called "Zero Point" about virtual reality headsets, made specifically for the Oculus Rift.


  • You can see some cool examples of oculus rift at following links:-
  1. http://www.youtube.com/watch?v=75f12kDE2Pk
  2. Google Street View through oculus rift : http://www.youtube.com/watch?v=Qo4tgrcLt58 



Flexible Speakers :


  • A loudspeaker, which is less than 0.25mm thick, is the latest invention in technology presented by engineers from University of Warwick. 

  • The device is flexible and can be easily hung up a wall in an apartment.

  • Due to its specific technique of producing sound, it can be used as a way of making clear public announcements in different places, such as passenger terminals.

  • The flexible speaker works by transforming an electric signal into sound. 

  • In conventional speakers the signal is used to produce a varying magnetic field that vibrates a mechanical cone, thus making the sound. 

  • However, the technology behind these flexible speakers connects thin, conducting and insulating, materials that create a flexible laminate. When an electrical signal excites the laminate, it vibrates, so generating sound.