We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Article to read https://www.mongodb.com/docs/manual/core/timeseries/timeseries-secondary-index/#std-label-timeseries-add-secondary-index https://www.mongodb.com/docs/manual/core/timeseries/timeseries-limitations/?_ga=2.218194585.1481580001.1709754613-1997395561.1709455248
community discuss link https://www.mongodb.com/community/forums/t/time-series-how-to-get-the-most-recent-document/149455/6
The text was updated successfully, but these errors were encountered:
async function findMostRecent() { const bucket = await db.collection("system.buckets.weather").findOne( {}, { sort: { "control.max.timestamp": -1 }, projection: { "control.max.timestamp": 1 } } ); if (!bucket) return; return db.collection("weather").findOne({ timestamp: bucket.control.max.timestamp }); }
Sorry, something went wrong.
No branches or pull requests
Article to read
https://www.mongodb.com/docs/manual/core/timeseries/timeseries-secondary-index/#std-label-timeseries-add-secondary-index
https://www.mongodb.com/docs/manual/core/timeseries/timeseries-limitations/?_ga=2.218194585.1481580001.1709754613-1997395561.1709455248
community discuss link
https://www.mongodb.com/community/forums/t/time-series-how-to-get-the-most-recent-document/149455/6
The text was updated successfully, but these errors were encountered: