Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6978029
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T17:42:11+00:00 2026-05-27T17:42:11+00:00

Each document has a date property which is updated with new MongoDate() whenever the

  • 0

Each document has a date property which is updated with new MongoDate() whenever the document is modified.

How one can get N last modified documents? But not since some specific date. Just N documents with latest dates. Maybe something like sort only not as a cursor method, but a query parameter exists?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T17:42:12+00:00Added an answer on May 27, 2026 at 5:42 pm

    In a project I am working on, I use something like this to extract the last five entry, in reverse order (newest to older)

    for e in coll.find().sort("data_ins", -1).limit(5):
        # do something
    

    where data_ins is a timestamp, but I suppose it work on every sortable field.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a MongoDB collection which has a created_at stored in each document. These
I installed Acrobat Reader 9.0 last month, Each time I open a pdf document,
Each of my clients can have many todo items and every todo item has
I'm using MongoDB to hold a collection of documents. Each document has an _id
So I have an embedded document that tracks group memberships. Each embedded document has
I'm using a NSPersistantDocument backed by Core Data in my application. Each document has
I have a Log project, each log has a :date, :hours, :description. I am
I have to merge two xml documents using xslt 1.0. Each xml document has
I have a web form which has dynamic table using repeating rows. New rows
I've created an index with various bits of data for each document I've added,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.