No luck. I tried using day: 12 (and new Date()) and still got no
results. I don't think the date conversion is the problem b/c I've
> On 8 May 2012 00:08, Sam Millman <
sam.mill...@gmail.com> wrote:
>
>
>
>
>
>
>
> > Ok I think this is your problem:
>
> > "DateCreated": "Tue, 01 May 2012 16:30:59 GMT -05:00"
>
> > I dont think the JS Date object is capable of converting that syntax. You
> > should use your drivers Date() class to put dates into a ISODate() object
> > and use the localized syntax within ISO to allow you to represent GMT - 5.
>
> > Providing there isn't someting wrong with the reduce, which by the looks
> > of it there isn't (would require more testing) since it's a simple count
> > and return hopefully it should just be those dates.
>
> > There is one way to check, put a static value into your map for it to emit
> > on like so:
>
> > if (this.hasOwnProperty("SubDoc")) { // As seen:
> >
http://stackoverflow.com/questions/2281633/javascript-isset-equivalent
> > var day, date; // Lets globally define our variables
> > for(var row in this.SubDoc){ // For every row in our SubDoc
> > if(row.hasOwnProperty("DateCreated")){ // Have we got such a field?
>
> > date = Date(row.DateCreated); // convert the date to the JS version
>
> > day = date.getFullYear() + “-” +
> > date.getMonth() + “-“ +
> > date.getDate();
> > emit({day: 12} , {count: 1});
> > }
> > }
>
> > If you get one or more results your know its your dates doing it.
> > hasOwnProperty is fully supported by spider monkey so it should be nothing
> > to do with that, otherwise you'd get an error.
>