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

feathersjs-mongoose doesn't support $elemMatch as query. #434

Open
prescripson opened this issue Aug 6, 2022 · 0 comments
Open

feathersjs-mongoose doesn't support $elemMatch as query. #434

prescripson opened this issue Aug 6, 2022 · 0 comments

Comments

@prescripson
Copy link

My MongoDB document is like

image

I am trying to replicate that query with feathers-mongoose service find method.

Expected behabiour should be matched count 0, as in the original document the objectId 62ed2315399edd80209a502a only have create in the allow field array.

In MongoDB compass after execute the query the result become No Matchd ( Expected )

image

But, in feathers-mongoose service it returns with single match item. ( unexpected )

 async find(params?: Params | undefined): Promise<any[] | Paginated<any>> {
      return await super.find({query: {manage: {$elemMatch: {_id: new mongoose.Types.ObjectId('62ed2315399edd80209a502a'), allow: 'read'}}}})
  }

Although above code is just for demostration, in real scenario those queries are added by feathers-casl.

image

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