I have a table with a lot of entries. I want to iterate through all the rows by the same secondary index on multiple pages.
TABLE post {
uint64_t id;
name author;
string text;
auto primary_key() const {
return id;
}
uint64_t by_author() const {
return author.value;
}
};
typedef eosio::multi_index< "posts"_n, post ,
eosio::indexed_by< "author"_n, eosio::const_mem_fun<post, uint64_t, &post::by_author> >
> posts;
I have a table with 150 posts that have author "bob" Now when I use get table I limit the query to 100 rows how do I get more if the lower_bound is the exact same at all times, with author="bob"? Is there an offset possible?
{
"json":true,
"code":"blog",
"table":"posts",
"scope":"blog",
"table_key":"author",
"lower_bound": bobAsNumericName,
"upper_bound": bobAsNumericName+1,
"index_position":2,
"key_type":"i64",
"limit":100,
"reverse":false,
"show_payer":false
}
Oh and all rows are in the same scope.
basically I need to query for 100 blog posts from "bob" and then offset 100 entries and query for 100 more (In this case receive 50 entries and more=false)