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

keyf not working in .group() function

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • 1.1.1
    • Affects Version/s: 1.0.0
    • Component/s: JavaScript, Querying, Shell
    • None

      1. mongo test
        MongoDB shell version: 1.0.0
        url: test
        connecting to: test
        type "help" for help
        > db.test.save(
        Unknown macro: {a}

        )
        > db.test.save(

        Unknown macro: {a}

        )
        > db.test.save(

        Unknown macro: {a}

        )
        > db.test.save(

        Unknown macro: {a}

        )
        > db.test.save(

        Unknown macro: {a}

        )
        > db.test.save(

        Unknown macro: {a}

        )
        > db.test.group(

        Unknown macro: {key}

        )
        Thu Sep 3 13:17:19 JS Error: uncaught exception: group command failed:

        {"errmsg" : "can't only handle real keys right now, not functions" , "ok" : 0}

      > db.test.group({keyf: function(el){ return

      {el.a.b:true}

      ; }, initial:

      { count: 0 }

      , $reduce: function(o, i)

      { i.count += 1; }

      })
      Thu Sep 3 13:32:03 JS Error: SyntaxError: missing : after property id (shell):0

            Assignee:
            eliot Eliot Horowitz (Inactive)
            Reporter:
            ze_duff duff
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: