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

Add lean when returning data to save up memory #94

Open
Abhishek-kumar09 opened this issue Jun 19, 2021 · 3 comments
Open

Add lean when returning data to save up memory #94

Abhishek-kumar09 opened this issue Jun 19, 2021 · 3 comments
Labels
good first issue Good for newcomers mongo Related to mongo and mongoose

Comments

@Abhishek-kumar09
Copy link
Contributor

Lean mongoose doc: https://mongoosejs.com/docs/tutorials/lean.html

Currently we are returning the whole document even if the model doesn't need any further processes. Using lean with the models can be 10x more memory efficient.

@Abhishek-kumar09 Abhishek-kumar09 added good first issue Good for newcomers mongo Related to mongo and mongoose labels Jun 19, 2021
@zeel-codder
Copy link

Hi, I want to try to solve this issue. I am clone hole project after the fork. Then create .env file and fill the data in it. But while running the server at each API call I get bellow JSON output.

{ "statusCode": 409, "message": "Access Denied as Token does not exist", "error": "Conflict" }

Why I am getting this Error? please help me
Thank You

@Devesh21700Kumar
Copy link
Collaborator

Hi, I want to try to solve this issue. I am clone hole project after the fork. Then create .env file and fill the data in it. But while running the server at each API call I get bellow JSON output.

{ "statusCode": 409, "message": "Access Denied as Token does not exist", "error": "Conflict" }

Why I am getting this Error? please help me
Thank You

Hey ,
at a lot of API endpoints Auth middleware is set and role guards are set in some as well.
So you need to pass the token you get from the client side in the header for those requests to retrieve a response.

@zeel-codder
Copy link

Thanks,
I think you are talking about at /api i get authorizations prompt. I give the code, but it only works for /hello router and I am getting the same message for another route. And in /hello router I am also getting bellow message.

{
  "statusCode": 403,
  "timestamp": "2021-08-12T16:00:26.289Z",
  "path": "/",
  "message": "Decoding Firebase ID token failed. Make sure you passed the entire string JWT which represents an ID token. See https://firebase.google.com/docs/auth/admin/verify-id-tokens for details on how to retrieve an ID token.",
  "code": "auth/argument-error"
}

I check my .env file, it has all value right then why am I getting this, any idea.

Thank You

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers mongo Related to mongo and mongoose
Projects
None yet
Development

No branches or pull requests

3 participants