Skip to content

It's not calling my callbacks #7

Description

@nickretallack

The tests pass, and everything works if it happens to occur inside a listener like so:

mongo.addListener("connection", function () { 
    mongo.getCollection('widgets').count(null, function(count) { sys.puts(count) })
})

However, when I try to do this in any other context, the callback never happens. For example, if I set up a server like this, and hit it, nothing is printed to the console.

var port = 8000
http.createServer(function (req, res) {
    mongo.getCollection('widgets').count(null, function(count){
        sys.puts("found stuff!")
    })
}).listen(port)

In fact, even if I put this createServer stuff inside of a connection callback, it still doesn't work.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions