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 support for mongoose skipInvalidIds #166

Open
sfxvomolayo opened this issue Aug 7, 2020 · 0 comments
Open

Add support for mongoose skipInvalidIds #166

sfxvomolayo opened this issue Aug 7, 2020 · 0 comments

Comments

@sfxvomolayo
Copy link

When calling Model.paginate({}, { populate: "relation", skipInvalidIds: true}) on a document.

Given there are some invalid/no-id value in the document path

The expected behavior would be that if the path consists of invalid Id from the DB, it should be ignored.

But error: Cast to ObjectId failed for value "not-an-id" at path "model-path" is thrown

currently Mongoose support option { justOne: true, skipInvalidIds: true} to do this.

Is there a way to achieve this currently?

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

1 participant