To create an index, you need to use ___ method of MongoDB

34. To create an index, you need to use ___ method of MongoDB.

  1. createTable()
  2. createIndex()
  3. createdata()
  4. None of the mentioned above

Answer: B) createIndex()

Explanation:

Indexes aid in the quick and efficient resolution of query requests. In the absence of indexes, MongoDB must scan every document in a collection in order to select the documents that match the search query statement. It is necessary to use the createIndex() method of MongoDB in order to create an index. Indexes are special data structures that are used to store a small portion of a data set in a format that is easy to navigate. It stores the value of a specific field or set of fields, ordered by the value of the field as specified in the index, and it does so in an organized manner.

Comments and Discussions!

Load comments ↻






Copyright © 2024 www.includehelp.com. All rights reserved.