".aggregate is not a function" in 2.2 . Documentation outdated?

1,290 views
Skip to first unread message

Daniel

unread,
Sep 5, 2012, 4:13:51 PM9/5/12
to mongod...@googlegroups.com
Hi,

I have 2.2 installed, in production and playing around with the aggregation pipeline. on my collection e.g "col1"
db.col1..aggregate(...) doesn't work

db.col1.aggregate is not a function (shell):1

 After searching a lot because documentation says that ".aggregate"

db.runCommand({ aggregate : "col1", pipeline : [...]}) 

works. Is the documentation outdated for 2.2.?

Thanks & regards

Daniel 

David M. Carr

unread,
Sep 5, 2012, 4:48:07 PM9/5/12
to mongod...@googlegroups.com
> --
> You received this message because you are subscribed to the Google
> Groups "mongodb-user" group.
> To post to this group, send email to mongod...@googlegroups.com
> To unsubscribe from this group, send email to
> mongodb-user...@googlegroups.com
> See also the IRC channel -- freenode.net#mongodb

It works for me. Perhaps you have an outdated client or server and
don't realize it? I'd try running "mongo --version" in a
command-prompt and "db.version()" while connected to the database to
double-check, if you haven't already.

--
David M. Carr
davi...@gmail.com

Daniel

unread,
Sep 5, 2012, 5:14:40 PM9/5/12
to mongod...@googlegroups.com
It's a fresh 2.2. installation:

mongos> db.version();
2.2.0

Daniel

unread,
Sep 5, 2012, 5:16:01 PM9/5/12
to mongod...@googlegroups.com
same on the command line:

$ mongo --version
MongoDB shell version: 2.2.0

Daniel

unread,
Sep 6, 2012, 4:27:55 AM9/6/12
to mongod...@googlegroups.com
Uh. I think i was connecting remotely with an older client 2.0.3. That's why this happened. Sorry.
Reply all
Reply to author
Forward
0 new messages