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

Invalid query parameter $elemMatch #384

Closed
H3r3zy opened this issue Jun 15, 2020 · 0 comments
Closed

Invalid query parameter $elemMatch #384

H3r3zy opened this issue Jun 15, 2020 · 0 comments

Comments

@H3r3zy
Copy link

H3r3zy commented Jun 15, 2020

Hello,

In one of my project I need to find an object with characteristics store in array in this object.
like:

{
  name: 'Item1',
  characteristics: [
    {
      id: 1213,
      value: 12,
      otherField: '...',
      ...
    },
  ],
  ...
}

My search method is based on characteristics Id and value so I wanted to use $elemMatch.
But when I used it, an error occured.

'Invalid query parameter $elemMatch'

Steps to reproduce

ctx.app.services.items.find({
  query: {
    characteristics: {
      $elemMatch: {
        id: 1213,
        value: 12,
     },
   }
});

Expected behavior

What is expected is that the item with a characteristic with id 1213 and value 12 must be retrieve.

Actual behavior

Actually the result is an error: 'Invalid query parameter $elemMatch'

System configuration

I use feathersjs + feathers-mongoose

Module versions (especially the part that's not working):
feathers-mongoose: 8.3

NodeJS version:
12.17.0

Operating System:
WSL

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