Skip to content

Retrieve a value from find() #3

@bry4n

Description

@bry4n

I could not figure out how to retrieve a value from MongoDB#find()

Example:

examples.insert({ name: "Guest" })
results = examples.find()

or

examples.insert({ name: "Guest" })
results = examples.find().addCallback(function(results) {
    return results
})

I wanted to do something like that instead of this

var results = ""
examples.find().addCallback(function(stuffs) { results = stuffs })
p(results) #=> ""

Last example is acting like variable results is static and unable to modify it.

Any thought?

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