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

Does mongodb need lots of ram?

1 Answers  


What is mongodb config server?

1 Answers  


When did mongodb go public?

1 Answers  


How does mongodb replication work?

1 Answers  


Do mongodb databases have tables and schemas?

1 Answers  


Does mongodb require a schema?

1 Answers  


Is mongodb better than sql?

1 Answers  


Is mongodb good for transactional?

1 Answers  


In mongodb, how sharding and replication work together?

1 Answers  


What type of dbms is mongodb?

1 Answers  


What is the use of limit() function in mongodb?

1 Answers  


Which operations lock the database in mongodb?

1 Answers  


Categories