Skip to content

Filtering objects by date #85

@rem7

Description

@rem7

How do you filter by time.Time? I was trying to filter Amazon S3 Objects from the list api and I can't get it to work in go, but I can get it to work in jmespath.org.

This seems to work in jmespath.org but not in go-jmespath
[?LastModified>'2023-01-23T00:00:00Z' && LastModified<'2023-04-01T00:00:00Z']

Here is an example

[
  {
    "ChecksumAlgorithm": null,
    "ETag": "\"d41d8cd98f00b204e9800998ecf8427e\"",
    "Key": "images-demo/",
    "LastModified": "2023-03-23T21:07:02Z",
    "Owner": null,
    "Size": 0,
    "StorageClass": "STANDARD"
  },
  {
    "ChecksumAlgorithm": null,
    "ETag": "\"8fe2b567e7ded83cbf12c76104da11b4\"",
    "Key": "images-demo/1.jpg",
    "LastModified": "2023-03-23T21:07:21Z",
    "Owner": null,
    "Size": 5104348,
    "StorageClass": "STANDARD"
  },
  {
    "ChecksumAlgorithm": null,
    "ETag": "\"0fba471e21efe99aba7a9caf20cab050\"",
    "Key": "images-demo/7.jpg",
    "LastModified": "2023-04-19T22:26:08Z",
    "Owner": null,
    "Size": 207020,
    "StorageClass": "STANDARD"
  }
]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions