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

TypeError: Object #<SkinClass> has no method 'toArray' #148

Open
avinashega opened this issue Nov 17, 2014 · 1 comment
Open

TypeError: Object #<SkinClass> has no method 'toArray' #148

avinashega opened this issue Nov 17, 2014 · 1 comment

Comments

@avinashega
Copy link

aggregation query returns a cursor in Mongo 2.6. According to native-mongodb-driver documentation, to read the cursor, we do something like this:

var MongoClient = require('mongodb').MongoClient;
MongoClient.connect("mongodb://localhost:27017/test", function(err, db) {
  var collection = db.collection("ag");

  var cursor = collection.aggregate([{ $group : {_id: '$a'}}], {cursor:{batchSize:100}});
 var docs = cursor.toArray();
});

when I try the same with Mongoskin 1.4.4, I get the error:

TypeError: Object #<SkinClass> has no method 'toArray'
@FullStackForger
Copy link

Hi. Any update on this?
I am using hapi-app-mongo-model which is built over monk, which is built over mongo-skin... that fix would be really appreciated

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