Uploaded image for project: 'Java Driver'
  1. Java Driver
  2. JAVA-470

In { "$regex":"foo", "$options":"i" } form, $options is not optional

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Minor - P4
    • Resolution: Fixed
    • 2.7
    • 2.8.0
    • API

    Description

      Core server unit tests show that it's permissible to leave off the $options field, as requested in SERVER-275 :
      https://github.com/mongodb/mongo/blob/8190d8db538c629973a3a581a97251b22b668c7a/jstests/regex2.js#L43-47

      However, Java driver will error out if one doesn't supply the $options field with a $regex query form. The following line is caller's ticket to (iirc) a NullPointerException :
      https://github.com/mongodb/mongo-java-driver/blob/master/src/main/com/mongodb/util/JSONCallback.java#L94

      Attachments

        Activity

          People

            scotthernandez Scott Hernandez
            dampier T. Dampier
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: