-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Retrieve a value from find() #3
Comments
Hey Bry4n, this is behaviour is definately by design. In your examples,
It takes a while to get used to this style, but trust me, it's really powerful. Your program can be doing other stuff (instead of idly waiting) while waiting on IO. |
Thanks for the answer. The reason I asked for solution because I am using visionmedia's express (node.js web framework) I tried this in express:
Unfortunately, the browser is hanging and asking for the return of value. Any thought? |
I don't know that framework, but it should provide an asynchronous way to complete the request. Glancing at it's docs, it looks like it uses 'this'. It'd probably be something like: |
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
results
is static and unable to modify it.Any thought?
The text was updated successfully, but these errors were encountered: