Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


What is the basic syntax to use index in mongodb?



What is the basic syntax to use index in mongodb?..

Answer / Rahul Bhatia

In MongoDB, creating an index can be done using the following syntax: `db.collection.createIndex( { field1: -1 } `. The `field1` refers to the field you want to index and the `-1` indicates ascending or descending order of the index (in this case, it is descending).

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More MongoDB Interview Questions

Which are the most powerful features in mongodb?

1 Answers  


What is mongodb cluster?

1 Answers  


What is the syntax of update document?

1 Answers  


How do you display the list of all collections of current database?

1 Answers  


What is the difference between mongodb and redis database?

1 Answers  


How did mongodb get its name?

0 Answers  


What is a storage engine in mongodb?

1 Answers  


Where are mongodb databases stored?

1 Answers  


Mention what is the command syntax for inserting a document?

1 Answers  


Can mongodb used for cache management?

1 Answers  


How do I create a collection in mongodb?

1 Answers  


How to perform transactions/lock in mongodb?

1 Answers  


Categories