Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ошибка при выполнении mapReduce в примере главы 6 #25

Open
uniconstructor opened this issue Jun 13, 2015 · 1 comment

Comments

@uniconstructor
Copy link

В шестой главе, в разделе "чистая практика" есть пример функций map и reduce. При попытке его запустить консоль выдает ошибку:

db.hits.mapReduce(map, reduce, {out: {inline:1}})
2015-06-14T02:04:33.794+0300 E QUERY    Error: map reduce failed: {
"errmsg" : "exception: TypeError: Cannot call method 'getFullYear' of undefined\n    at _funcs1 (_funcs1:2:53) near 'this.date.getFullYear(), month: this.date'  (line 2)",
"code" : 16722,
"ok" : 0
}
at Error (<anonymous>)
at DBCollection.mapReduce (src/mongo/shell/collection.js:1353:15)
at (shell):1:9 at src/mongo/shell/collection.js:1353

Кто хорошо знает JS подскажите: у объекта date точно есть функция getFullYear?

@manokonov
Copy link

Лучше поздно, чем никогда :)
'date' ключевое слово в mongodb.
Если заменить в коде 'date', например, на 'date_', то все отработает без ошибок.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants