rwynn / monstache

a go daemon that syncs MongoDB to Elasticsearch in realtime. you know, for search.
https://rwynn.github.io/monstache-site/
MIT License
1.28k stars 181 forks source link

decending sorting #711

Open eirik-andersen opened 7 months ago

eirik-andersen commented 7 months ago

thanks for the greate software to sync mongodb to elastic.

when using the findOne method in the transformation to do a lookup in the database, is it possible to have it select the last record and not the first?

Joey0538 commented 7 months ago

If you have any field that you can use to determine the first record or the last record, something like timestamp maybe createdAt, _updatedAt etc. or based on your criteria for sorting, it should be easy to achieve what you want.

Are you using js or go plugin?