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

Field xxx of text index contains an array in document

    XMLWordPrintable

    Details

    • Type: Question
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Done
    • Affects Version/s: 3.6.0, 3.6.1, 3.6.2
    • Fix Version/s: None
    • Component/s: Indexing
    • Labels:
      None

      Description

      Hi,

      why can't text indexes not contain an array anymore?

      Document:

      > db.employee.findOne()                             
      {                                                                                                  
              "allUnitIds" : [                            
                      "054edeaf-5efd-43b8-abe2-04164d9071a5"                                                   
              ],                                          
              "allSearchableStrings" : "..."                 
      }      
      

      Indexcreation

      > db.employee.createIndex({ "allSearchableStrings" : "text" , "allUnitIds" : 1})                         
      {                                                   
              "ok" : 0,                                   
              "errmsg" : "Field 'allUnitIds' of text index contains an array in document: { _id: \"2d937bbf-8a4f-4688-8821-a951971ba5e6\", allUnitIds: [ \"054edeaf-5efd-43b8-abe2-04164d9071a5\" ], allSearchableStrings: \"...\" }",
              "code" : 201,                               
              "codeName" : "CannotBuildIndexKeys"         
      }  
      

      It was at least possible with 3.4.x

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              mark.agarunov Mark Agarunov
              Reporter:
              pwirth Phillip Wirth
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              10 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: