Simplify your stack and build anything. Or everything.
Build tomorrow’s web with a modern solution you truly own.
Code-based nature means you can build on top of it to power anything.
It’s time to take back your content infrastructure.

Error Querying createdAt Attribute in access control

default discord avatar
sandrowegmann2 years ago
2

When trying to return a query constraint for the createdAt attribute, I get the following error.



Access control function:


 read: () => {
      return ({
        createdAt: {
          greater_than: new Date(new Date().getTime() - 1000 * 60 * 60)
        }
      })
    },

Error:


 {
            "name": "QueryError",
            "message": "The following path cannot be queried: createdAt",
            "data": [
                {
                    "path": "createdAt"
                }
            ]
        }

Is this expected behaviour?

  • default discord avatar
    evilted2 years ago

    Do not think so, upgraded from 1.6.28 to 1.7.2 and started seeing the same thing :/



    Same applies to

    updatedAt

    property

Star on GitHub

Star

Chat on Discord

Discord

online

Can't find what you're looking for?

Get dedicated engineering support directly from the Payload team.