Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-9272

Querying latest document based on a set of field

    • Type: Icon: New Feature New Feature
    • Resolution: Duplicate
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: 2.4.1
    • Component/s: Querying
    • None

      It would be good if querying can support filtering of recent documents based on certain document fields. For example:

      > db.logs.find()
      {
      'id': ObjectId("50ad8d451d41c8fc58000003")
      'name': 'Sample Log 1',
      'uploaded_at: ISODate("2013-03-14T01:00:00+01:00"),
      'case_id: '50ad8d451d41c8fc58000099',
      'tag_doc': {
        'group_x: ['TAG-1','TAG-2'],
        'group_y': ['XYZ']
      }
      },
      {
      'id': ObjectId("50ad8d451d41c8fc58000004")
      'name': 'Sample Log 2',
      'uploaded_at: ISODate("2013-03-15T01:00:00+01:00"),
      'case_id: '50ad8d451d41c8fc58000099'
      'tag_doc': {
        'group_x: ['TAG-1'],
        'group_y': ['XYZ']
      }
      }
      

      Both documents contain the same case_id. The user can filter out all the most recently uploaded document for each unique combination of fields, for example case_id and group_y. This is helpful in aggregating on a large collection of multiple version of documents.

            Assignee:
            rassi J Rassi
            Reporter:
            mnsndrs Mervin San Andres
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: