Brendan W. McAdams
added a comment - Sep 27 2011 08:19:17 AM +00:00 Taking a look at this. Trying to sort out what the issue is. There are a few issues in mapping to the java library from Casbah in the current release which the fixes are queued up for 2.2

Which causes an explicit compile error [1]. In the comment above, I was able to have the js compile without error using

val map = "function (){ emit(

{ topic: this.topic }

,

{ count: 1 }

); }"

There was also no js compile error when using your suggestion

val map = "function (){ emit( this.topic ,

{ count: 1 }

); }"

But the problem is that no results are returned as much as a js compile error. I can only assume since this works from command line, that the error is not something I'm doing wrong, and that something gets lost between Casbah->Java->Mongo and back.

If this is known issue the 2.2 release fixes, that seems straightforward. If the js shell and js raw is not identical, perhaps I'm missing some documentation about this?

In the end, I've settled on using casbah's mapreduce, outputting to another table. There's no sharding yet, but group() prevents me from using sort(), limit() etc.

This bug report is hopefully a helpful indication of the usability of querying. The eval() , command line, and other interfaces would be easier to learn with either better documentation and/or consistency.

Jonathan Hendler
added a comment - Oct 02 2011 08:44:45 PM +00:00 In the end, I've settled on using casbah's mapreduce, outputting to another table. There's no sharding yet, but group() prevents me from using sort(), limit() etc.
This bug report is hopefully a helpful indication of the usability of querying. The eval() , command line, and other interfaces would be easier to learn with either better documentation and/or consistency.
HTH