Skip to content

It's not calling my callbacks #7

@nickretallack

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.

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