Mongodb Classroom image

Anil  Bist / Professional / DataBase

 
To post your Question Join Classroom
 
Lesson Topics's No:-  |1 | 2 | 3|Last
Lessons:-Index Creation Basics

            Indexes

Index Creation Basics

See the below transactions collection.

 

get Indexes() functions will show all the indices available for a collection.

db.transactions.getIndexes();

 

Let see the output of above statement.

 

There is already one index for transaction collection. This is because MongoDB creates a unique index on the _id field during the creation of a collection. The _id index prevents clients from inserting two documents with the same value for the _id field. You cannot drop this index on the _id field. 

Now let's add an index for cr_dr field;

db.transactions.createIndex ({ cr_dr : 1 });

 

The result of the index execution is as follows.

 

 
 
 
image
Anil  Bist

Skills    Mongodb

Qualifications :- High School - SLV, College/University - Graphic Era Deemed Univ University,
Location :-Dehradun,Dehradun,Uttarakhand,India
Description:-

in 2006, i Join a web development company in Bangalore and start work on "Ruby on Rail" this is my first web development framework and we worked in this framework and develop four to five project after some time , I moved to JEE/Sturst frame work,

After some time i decided that now times come and I have to go on in my own way and I started a company name is "Soarlogic&q
Explore

 

  Students (0)