unknown top level operator: $populate
See original GitHub issueSteps to reproduce
- Create new application using feathers-cli
- add feathers-mongoose
- generate two mongoose models
- add ref to another model, whitelist
$populate
in service
Expected behavior
It should return data with populate model
Actual behavior
It is throwing GeneralError
with the above message
I think the issue is at service.js#101, where we are passing query object to mongoose with $populate. Omitting with _.omit(query, '$populate')
is solving the problem.
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Getting 'Unknown top level operator $or' - MongoDB
I have an app deployed on heroku, which keeps crashing because of this error: events.js:291 2020-12-09T16:08:01.009305+00:00 app[worker.1]: ...
Read more >bad query: BadValue unknown top level operator: $gte - Stack ...
I tried to run it on mongodb server and received an error as following - "exception: bad query: BadValue unknown top level operator:...
Read more >MongoDB unknown top level operator-mongodb
Well I'm having problems with aggragate of the mongo, I need to validate if in all the answers it doesn't have a field...
Read more >Can't canonicalize query: BadValue unknown top level ...
com.mongodb.MongoException: Can't canonicalize query: BadValue unknown top level operator: $ne ... Any idea how to repair or workaround this issue? Responses (4).
Read more >Node.js – Mongodb – unknown top level operator: $elemMatch ...
Node.js – Mongodb – unknown top level operator: $elemMatch”. mongodbmongoosenode.js. I have a collection which contains some documents as follows,
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Should be fixed via https://github.com/feathersjs-ecosystem/feathers-mongoose/pull/295
any update?