Back

Timestamp or document creation date.

  • 0
  • Databases
Victor1337
26 Nov, 2023, 14:21

Is there a .now() from the DB server time, possibility when creating a document on maybe an attribute (created_at) ?

Getting this from client is not reliable. Spinning a cloud function for this is not ok.

The underlying mysql DB has this option build in, just wanted to know if it can be used.

TL;DR
The user is asking if it is possible to sort documents in the Console. They mention that although it is not currently possible to sort in the Console, sorting can be done with the `listDocuments` function. They also found information on GitHub, but not in the official documentation. The user asks if there is a possibility of using the `$createdAt` and `$updatedAt` parameters to sort documents in the console. They also want to know if there is a way to access the DB server time, such as using `.now()` when creating a document. The user mentions that getting the timestamp from the client is not reliable and using a cloud function
ideclon
26 Nov, 2023, 16:04

Every Document has a $createdAt and $updatedAt parameter

Victor1337
26 Nov, 2023, 16:13

Did eventually found this. But this is not available to sort elements into the console (admin) right ?

Victor1337
26 Nov, 2023, 16:14

Also could not really find the 2 in the docs. 👀

Victor1337
26 Nov, 2023, 16:14

Found them on GitHub

ideclon
26 Nov, 2023, 16:15

You can’t currently sort in the Console, but you can have it sorted with listDocuments

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more