Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-6854

partial index supported expression types

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Won't Fix
    • Icon: Minor - P4 Minor - P4
    • Server_Docs_20231030
    • None
    • manual, Server
    • None

    Description

      Partial Index creation does not support regular expressions. For example, the following command will fail:

      > db.mycollection.createIndex({'myarray.category':1}, {partialFilterExpression: {'myarray.category': {$regex: /^FOO/} }})
      {
        "ok": 0,
        "errmsg": "unsupported expression in partial index: myarray.category regex /^FOO/\n",
        "code": 67
      }
      

      It might good to note this (and/or list the supported expression types) in the Restrictions section.

      Attachments

        Activity

          People

            kay.kim@mongodb.com Kay Kim (Inactive)
            jake.angerman Jake Angerman
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              1 year, 14 weeks, 1 day ago