Skip to content
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

How to return simple result of all methods .create, findAll, ..... (async/await)? #11403

Closed
thearabbit opened this issue Sep 8, 2019 · 2 comments

Comments

@thearabbit
Copy link

I base on Meteor JS.
I used async/await.
How to get the simple/raw result of all methods create, findAll, .....
Example:

Meteor.methods({
  async createEmployee(params) {
    let result = await Employee.create(params)
    console.log(result)

    return result
  },
  async getEmployees() {
    let result = await Employee.findAll()
    console.log(result)

    return result
  },
})
..........

Server log

image

UnhandledPromiseRejectionWarning: RangeError: Maximum call stack size exceeded

Please help me

@sushantdhiman
Copy link
Contributor

Please use Github Issue Tracker only for reporting bugs, requesting new features or discussions. Ask questions on Stackoverflow sequelize.js tag or Slack. While I would like to help answer any questions but it still take too much time.

If you are reporting a bug please isolate it as SSCCE, present it nicely and follow issue template. This will help maintainers and contributors understand your issue quickly.

If you are requesting a feature spend some time to properly present your use case with some examples, current and expected outcome.

( What is SSCCE ? You can find template for Sequelize here )

A few good example of SSCCE

  1. ResourceRequest timed out - connection not reestablished after db restarted #8014 (comment)
  2. removeAttribute('id') results in undefined: null data value #7318 (comment)
  3. toJSON converting booleans to "t" (true) or "f" (false) #8749 (comment)

@thearabbit
Copy link
Author

Very thanks for your reply.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants