Skip to content

Conversation

@tenorok
Copy link
Contributor

@tenorok tenorok commented Nov 19, 2020

Despite the use of lean() mongoose returns _id field as instance of ObjectId. But in cached result this field returned as a string.

@tenorok
Copy link
Contributor Author

tenorok commented Nov 29, 2020

@boblauer what do you think?

@tenorok
Copy link
Contributor Author

tenorok commented Dec 19, 2020

@boblauer pay attention please :-)

@aalfiann
Copy link

your code seems broken, have you try npm run lint ?

but your idea is great, I agree with this, the _id must return back as ObjectId from cache result.

@aalfiann
Copy link

For best perfomance, you have to use for loop than map.

  • for is faster than forEach.
  • forEach is faster than map.

you must consider of this because cachedResults may have big data array.

@tenorok
Copy link
Contributor Author

tenorok commented Feb 23, 2021

@aalfiann you're fully right about performance, I just tried to follow current codestyle. In the latest commit I've remake realization to more faster.

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

Successfully merging this pull request may close these issues.

2 participants