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
Hi, I was referring this project to implement pagination in my own project. I wanted to ask is there anyway to merge the count and data fetching queries.
Here you are traversing the tweetsCollection 2 times - once for the total pages count and another time for fetching data. Is there anyway to do it in single query.
I tried this but it isn't working
val result = transactions.aggregate<Test>(
facet(
Facet("count",
count()
),
Facet(
"transactions", listOf(
skip((pageNo -1) * size),
limit(size)
)
)
)
).first()
println(result.transactions)
println(result.count)
data classTest(valcount:Long, valtransactions:List<Transaction>?)
I get this error
Cannot deserialize value of type `long` from Array value (token `JsonToken.START_ARRAY`)\n at [Source: de.undercouch.bson4jackson.io.LittleEndianInputStream@11c18e82; pos: 7] (through reference chain: TransactionRepository$Test[\"count\"])
you have any idea on it?
The text was updated successfully, but these errors were encountered:
Hi, I was referring this project to implement pagination in my own project. I wanted to ask is there anyway to merge the count and data fetching queries.
maadb-project/nosql-analytics-server/src/main/kotlin/edu/unito/maadb/analytics/nosql/Datasource.kt
Lines 105 to 121 in 297ba70
Here you are traversing the tweetsCollection 2 times - once for the total pages count and another time for fetching data. Is there anyway to do it in single query.
I tried this but it isn't working
I get this error
you have any idea on it?
The text was updated successfully, but these errors were encountered: