Open hawkins48b opened 5 years ago
Issue is a follow up of https://github.com/moleculerjs/moleculer-db/issues/122
same here.
I use moleculer-db with mongodb adapter. sort not working well :(
2019-12-11T02:18:57.521Z 2019-12-10T12:05:47.189Z 2019-12-10T10:21:48.368Z 2019-12-10T10:18:47.660Z 2019-12-10T10:25:25.689Z 2019-12-10T10:22:25.935Z
Prerequisites
Create a collection with basic data
Current Behavior
Perform a textual search with method 'find' or 'list'
Does not sort results at all.
Expected Behavior
We should be able to sort data with a text search.
As stated by the documentation, list should be able to perform a textual search and sort : https://moleculer.services/docs/0.13/moleculer-db.html#find https://moleculer.services/docs/0.13/moleculer-db.html#list
Again, I found out that the base adapter (memory) works. It is related to mongo. As a workaround, I use the 'find' method and sort results myself.
Steps to reproduce
Use the official example as a base : packages/moleculer-db-adapter-mongo/examples/search/index.js
Context