[SERVER-278] keyf not working in .group() function Created: 03/Sep/09  Updated: 12/Jul/16  Resolved: 15/Sep/09

Status: Closed
Project: Core Server
Component/s: JavaScript, Querying, Shell
Affects Version/s: 1.0.0
Fix Version/s: 1.1.1

Type: Bug Priority: Minor - P4
Reporter: duff Assignee: Eliot Horowitz (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Participants:

 Description   
  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



 Comments   
Comment by duff [ 03/Sep/09 ]

Is it possible to also get some examples on how to use keyf in the docs as well? ta

Generated at Thu Feb 08 02:53:36 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.