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 |
Which are the most powerful features in mongodb?
What is mongodb cluster?
What is the syntax of update document?
How do you display the list of all collections of current database?
What is the difference between mongodb and redis database?
How did mongodb get its name?
What is a storage engine in mongodb?
Where are mongodb databases stored?
Mention what is the command syntax for inserting a document?
Can mongodb used for cache management?
How do I create a collection in mongodb?
How to perform transactions/lock in mongodb?
Oracle (3253)
SQL Server (4518)
MS Access (429)
MySQL (1402)
Postgre (483)
Sybase (267)
DB Architecture (141)
DB Administration (291)
DB Development (113)
SQL PLSQL (3330)
MongoDB (502)
IBM Informix (50)
Neo4j (82)
InfluxDB (0)
Apache CouchDB (44)
Firebird (5)
Database Management (1411)
Databases AllOther (288)