Skip to content

⬆️ Mongoose v7 Support #454

Open
@mdaronco

Description

@mdaronco

Steps to reproduce

Execute a programmatic call to a feathers-mongoose service using the $limit parameter:

const res = await this.app.service('my-service').find({
    query: { $limit: 1, }
}); // an error is thrown by Mongoose

(First please check that this issue is not already solved as described
here
)

  • Tell us what broke. The more detailed the better.
  • If you can, please create a simple example that reproduces the issue and link to a gist, jsbin, repo, etc.

Expected behavior

Mongoose should not throw an error up to the caller.

Actual behavior

The following error is thrown by Mongoose version 7.x:

MongoServerError: unknown top level operator: $limit. If you have a field name that starts with a '$' symbol, consider using $getField or $setField.

when calling a Feathers service with the query.$limit parameter specified.

System configuration

Tell us about the applicable parts of your setup.

Module versions (especially the part that's not working):

"@feathersjs/errors": "^5.0.9",
"@feathersjs/express": "^4.5.18",
"@feathersjs/feathers": "^4.5.12",
"@feathersjs/transport-commons": "^4.5.18",
"feathers-mongoose": "^8.5.1",
"mongoose": "^7.6.3",

NodeJS version: v20.10.0

Operating System: MacOS Sonoma 14.1.2 (23B92)

Browser Version: (N/A) Chrome Version 119.0.6045.199 (Official Build) (arm64)

React Native Version: N/A

Module Loader: commonjs

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions