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 |
Does mongodb need lots of ram?
What is mongodb config server?
When did mongodb go public?
How does mongodb replication work?
Do mongodb databases have tables and schemas?
Does mongodb require a schema?
Is mongodb better than sql?
Is mongodb good for transactional?
In mongodb, how sharding and replication work together?
What type of dbms is mongodb?
What is the use of limit() function in mongodb?
Which operations lock the database 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)