Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-28058

Able to create TTL index on single key which is previously indexed

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 3.4.1
    • Component/s: Index Maintenance, TTL
    • None
    • ALL
    • Hide

      1) Created the single field index.
      2) Create a TTL index on the same Key field

      Show
      1) Created the single field index. 2) Create a TTL index on the same Key field

      As per the documentation for 3.4, if a non-TTL single-field index already exists for a field, you cannot create a TTL index on the same field since you cannot create indexes that have the same key specification and differ only by the options. To change a non-TTL single-field index to a TTL index, you must drop the index first and recreate with the expireAfterSeconds option.

              {
                      "v" : 2,
                      "key" : {
                              "date" : 1
                      },
                      "name" : "date_1",
                      "ns" : "training.toys"
              },
              {
                      "v" : 2,
                      "key" : {
                              "date" : 1,
                              "expireAfterSeconds" : 3900
                      },
                      "name" : "date_1_expireAfterSeconds_3900",
                      "ns" : "training.toys"
              }
      

            Assignee:
            mark.agarunov Mark Agarunov
            Reporter:
            compchap_nikhil Nikhil Kumar Gupta
            Votes:
            0 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved: