Good evening sorry if I am not very clear, I am writing with the translator.
I would like to know if I can use dates as properties and then make consultations with operators. Example: Fecha_desde greater than or equal to 2020-01-01
Depends on what you need.
Dates as integers can be evaluated with < and > and =
For example:
20230912 > 20230911 would evaluate to true.
In queries we can get property values and we can give the query today’s day for example.
So we can ask if the property value is equal to today for example.
Perfect, thank you very much for your response.
In the case in which I have notes that already come from the calendar, for example, in Logseq I have a way to apply a function and take a date written with dashes as a number, example: 2023-09-13 and convert it to 20230913. Or just Should I convert and reindex the entire graph?
Thanks again.
So in advanced queries you can do something like this.
[(str ?d) ?sd]
[(re-pattern "(\\d{4})-(\\d{2})-(\\d{2})") ?rx]
[(re-find ?rx ?sd) [_ ?yyyy ?mm ?dd]]
[(str ?yyyy ?mm ?dd) ?datestring]
[(* 1 ?datestring) ?date]
[(< ?date ?other date)]
Thank you so much.
I don’t understand? What language do you use?
Where are advanced queries entered?
This is just part of the advanced queries. They are written in datalog language.
In logseq you can open the command window <
and select query to start an advanced query.
There are a lot of full examples on this site.
I would recommend starting with the official documentation:
https://docs.logseq.com/#/page/advanced%20queries
I’m going to check the site.
Thank you so much