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

"invalid property id" when using $or in mapreduce

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 2.0.5
    • Component/s: MapReduce, Querying
    • Environment:
      EC2; Amazon AMI; mongo is running in a sharded replicaset
    • Linux

      Using the m/r function with an $or query appears to be impossible right now. We are using the query below for one of our map reduces and are getting this error:

      SyntaxError: invalid property id

      mongo mentions line 78; below are lines 73-84:

      db.runCommand({
       mapreduce : "clients_raw",
       map : m,
       reduce : r,
       query : {
        { "_id.DAY": "2012-06-22" , $or : [ {"_id.CLIENT_ID": 123},  {"_id.CLIENT_ID": 456} ] }
       },
       out : {
        merge : "clients"
       },
       finalize : f
      });

      Running the query through a find generates the results we expect; removing the $or condition, too, generates results we expect. It seems as if combining $or with another field however, is not possible at this point.

            Assignee:
            aaron Aaron Staple
            Reporter:
            k.satirli Kerim Satirli
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: