Skip to content
New issue

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

Filtering objects by date #85

Open
rem7 opened this issue Apr 20, 2023 · 1 comment
Open

Filtering objects by date #85

rem7 opened this issue Apr 20, 2023 · 1 comment

Comments

@rem7
Copy link

rem7 commented Apr 20, 2023

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"
  }
]
@springcomp
Copy link

Comparison is officially only supported for numbers.

However, we are thinking about proposing type-conversion in an upcoming version of the spec.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants