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?
I could not figure out how to retrieve a value from MongoDB#find()
Example:
or
I wanted to do something like that instead of this
Last example is acting like variable
resultsis static and unable to modify it.Any thought?