I have an entity which has a column type bigint named price.
It is a very large table. I want to get data from this table until the price is greater than or equal to a number.
How can I achieve that without getting the entire table from result
@Entity()
export class myTable extends BaseEntity {
@Column({type:"bigint})
price:number
}
I want to get entities until the sum of the prices are greater than or equal to a number
const input: number = 50000
const result = await myTable.find(/*order by date and where sum (price) >= input*/)
What is the syntax and how can I do this? using baseEntity query or queryBuilder and preferably not the raw query result