You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In postgres, you can use DATE_PART to extract the week, the month etc. from a date.
I'd like to create a graphql query that will return the number of TodoItem created per week, for example.
I know from the example that nestjs-query generates a TodoItemCountAggregate and TodoItemAggregateGroupBy already but if I groupBy createdAt, it will group by the timestamp in ms.
Is it possible in some way to write a query which will make use of postgres powerful DATE_PART feature?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Let's say I have an entity like:
In postgres, you can use DATE_PART to extract the week, the month etc. from a date.
I'd like to create a graphql query that will return the number of
TodoItem
created per week, for example.I know from the example that nestjs-query generates a
TodoItemCountAggregate
andTodoItemAggregateGroupBy
already but if I groupBy createdAt, it will group by the timestamp in ms.Is it possible in some way to write a query which will make use of postgres powerful DATE_PART feature?
Beta Was this translation helpful? Give feedback.
All reactions