MongoDB Community Hub
How I can use sort function in findOne() function?
Working with Data
Node.js Frameworks
node-js
,
queries
,
mongoose-odm
Kobe_W
(Kobe W)
June 2, 2023, 6:11pm
6
An alternative is probably using
db.collection.find(filter).sort(xxx).limit(1)
1 Like
show post in topic