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

Object.property doesn't work with ObjectId in querying

    • Type: Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Priority: Icon: Critical - P2 Critical - P2
    • None
    • Affects Version/s: 1.6.5
    • Component/s: Querying
    • Labels:
      None
    • Environment:
      ubuntu php 5.3.3 php-mongo 1.10 mongodb 1.6.5-stable
    • Linux

      Querying an document like {str: 'something', obj: {sub1: ObjectId('123'), sub2: 456}} returns nothing while pure strings or integers works well

      Mon Jan 17 19:01:06 [conn2349] query: gaoren.test

      { obj.sub1: ObjectId('4d3421722973eb6246140000') }

      Mon Jan 17 19:01:06 [conn2349] used cursor: 0x15de360
      Mon Jan 17 19:01:06 [conn2349] query gaoren.test reslen:36 nreturned:0 0ms

      Mon Jan 17 19:01:06 [conn2349] query: gaoren.test

      { obj.sub2: 456 }

      Mon Jan 17 19:01:06 [conn2349] used cursor: 0x168a5c0
      Mon Jan 17 19:01:06 [conn2349] query gaoren.test reslen:115 nreturned:1 0ms

      Mon Jan 17 19:01:06 [conn2349] query: gaoren.test{ obj: { $elemMatch:

      { sub1: ObjectId('4d3421722973eb6246150000'), sub2: 456 }

      } }
      Mon Jan 17 19:01:06 [conn2349] used cursor: 0x15d1720
      Mon Jan 17 19:01:06 [conn2349] query gaoren.test reslen:36 nreturned:0 0ms

            Assignee:
            Unassigned Unassigned
            Reporter:
            littlexiang Xiang.Song
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: