Regular Expression on IPAddress format like does not work as expected

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Critical - P2
    • None
    • Affects Version/s: 2.4
    • Component/s: Query Operations
    • None
    • Environment:
      2.4 & Above
    • None
    • Fully Compatible
    • None
    • None
    • None
    • None
    • None
    • None

      I am using Mongo 2.4.9, and I use simple search for my application for IPAddress search.

      I give search some thing like: "192.168.1.1*" , but it returns even with IP Address starting from 192.168.2* and 192.168.4* which are in my db. It has to respond only with 192.168.1.1*. details of execution is below and it would be really great help if I know which version of latest MONGO has a fix for this kind of issue if at all be raised by some one already and have been fixed. If not fixed this is the major bug for my release this week.

      Query: { "$and" : [ { "ipAddress" : { "$regex" : "192.168.1.*"}}]}, Fields: null, Sort: null
      192.168.1.102
      192.168.1.114
      192.168.1.117
      192.168.1.123
      192.168.1.130
      192.168.1.140
      192.168.1.151
      192.168.1.155
      192.168.1.158
      192.168.1.182
      192.168.1.220
      192.168.1.221
      192.168.1.223
      192.168.1.224
      192.168.1.225
      192.168.1.226
      192.168.1.227
      192.168.1.228
      192.168.1.229
      192.168.1.230
      192.168.1.231
      192.168.1.232
      192.168.1.233
      192.168.1.234
      192.168.1.235
      192.168.1.236
      192.168.1.237
      192.168.1.238
      192.168.1.239
      192.168.1.240
      192.168.1.241
      192.168.1.242
      192.168.1.243
      192.168.1.244
      192.168.1.245
      192.168.1.246
      192.168.1.247
      192.168.1.248
      192.168.1.250
      192.168.1.251
      192.168.1.252
      192.168.1.253
      192.168.1.254
      192.168.1.255
      192.168.4.163
      192.168.4.63

            Assignee:
            Ross Lawley
            Reporter:
            Sridhar
            None
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: