Guys
In node.js, mongolian or mongo-native group function is not supported?
mongo-native code,
var mongodb = require('mongodb'); var Db = mongodb.Db; var Server = mongodb.Server; var db = new Db( "test", new Server( "localhost", 27017 ), { w:0 } ); db.collection( "user" ).group( { key: { }, reduce: function ( curr, result ) { }, initial: { } } );
result
/node/ex1/node_modules/mongodb/lib/mongodb/collection.js:1400 if(err != null) return callback(err); ^ TypeError: undefined is not a function at Collection.group.scope (/node/ex1/node_modules/mongodb/lib/mongodb/collection.js:1400:30) at Db._executeQueryCommand (/node/ex1/node_modules/mongodb/lib/mongodb/db.js:1812:12) at Collection.group (/node/ex1/node_modules/mongodb/lib/mongodb/collection.js:1399:13) at Object.<anonymous> (/node/ex1/repository.js:34:25)
and mongolign code,
var Mongolian = require( "mongolian" ); var server = new Mongolian; var db = server.db( "test" ); db.collection( "user" ).group( { key: { }, reduce: function ( curr, result ) { }, initial: { } } );
result
db.collection( "user" ).group( { ^ TypeError: Object Mongolian[mongo:
source share