Questions tagged [multi-index]

Questions related to Multi-Indexes for Smart Contracts Tables

18 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
2
votes
0answers
208 views

What are the main differences betwen EOSIO multi_index and Boost multi_index?

Inspired by this comment, I was wondering what are the main differences between eosio::multi_index and boost:multi_index and why do they exist? The documentation notes that there are important ...
1
vote
0answers
32 views

Fetching More Table Rows via RPC

I have a contract with a table in it. I'm querying the contents of the table using the RPC interface, but I'm having trouble getting all the rows. To limit the memory usage of my application, I'm ...
1
vote
2answers
196 views

Is there a way to query table with the value of a particular data field

Is there a way to query table with the value of a particular data field (for example, a token value) when using 'get_table rpc'? Only users whose token value is greater than 30 are output.
1
vote
0answers
32 views

cannot get latest state of table after modifying table in inline action

As shown with code below, I modify table in an inline action, and then want to get the latest data. But the data I get is not the latest. Why? void mycontract::myfunc() { action ( ...
1
vote
0answers
306 views

How do I add second and third indices to the multi_index object?

I have thoroughly read the documentation and isolated my problem down to a small set of sample code. I'm not sure where my problem is. I am trying to add multiple indices to a multi_index object so ...
0
votes
0answers
22 views

How to set vector type field as a secondary index in smart contract?

I want to set a group vector as a secondary index in the user smart contract. group is the list of groups. Following is the changes I am doing: struct [[eosio::table]] usertable { ...
0
votes
0answers
12 views

How to give and check relationship between two smart contracts?

I am working on two smart contracts Users and Groups. The relation is one user can have many groups. Can I have such a relation in these smart contracts? After smart contract deployment and data ...
0
votes
0answers
9 views

How to use/access the stored values in multi_index_table?

Hi I have a question about the multi Index table. So in my table I have the user name (primary key) and a uint64 choice. I have gone through the documentation on how to emplace, modify and delete ...
0
votes
1answer
51 views

Is there way to retrieve auto incremented primary key after submission of transaction?

I'm working on sample dApp application to understand the working of multi_index table in EOS smart contract. I have defined two multi_index table. The primary key of table1 is auto incremented using "...
0
votes
2answers
74 views

Use UUID as primary key in multi_index

How can I use a uuid as the primary. struct [[eosio::table]] blackboxdata { name user; std::string uuid; std::string hash; std::string sqlrequest; uint64_t ...
0
votes
1answer
34 views

Is it possible to see the RAM delta of a multi_index table operation, or see who is currently paying for a row in a table

My question is in the context of smart contract development, so I'm looking for solutions that work within smart contracts: 1st: Is is possible to see the RAM delta of either an individual ...
0
votes
1answer
30 views

Of what type is the return value of get_index?

Every single example out there that shows how to use a secondary index in the EOSIO platform, including the scant documentation on the function found here: https://eosio.github.io/eosio.cdt/latest/...
0
votes
0answers
20 views

Intersect multi index with vector

So i have a vector with eosio::names and my table has a primary key of the same type. I want the result of the intersection in my table as end result. Existing table data (other row fields) need to be ...
0
votes
0answers
41 views

Code abstraction

I need a little guidance. I've been structuring my code like this: #include <eosio/eosio.hpp> class [[eosio::contract("table")]] Square { private: struct [[eosio::table]] square { ...
0
votes
2answers
210 views

How to loop a multi_index table in a smart contract

I have very simple table items with the following structure: struct [[eosio::table]] item { uint64_t id; uint64_t state; string description; uint64_t primary_key() ...
0
votes
1answer
42 views

Contract won't keep index count inside index table

Attempting to keep track of an index for future use as an index in another container. uint64_t namehash = ::eosio::string_to_uint64_t(my_name.c_str()); auto name_iter = ...
0
votes
0answers
26 views

why it prints only one “record/row”?

I created a table with 5 rows/records. I tried to print the whole table content with the following code: require_auth(_self); accounts_table accounts(_self, _self.value); for(auto itr = accounts....
0
votes
1answer
54 views

How to retrieve filtered multi-index table data?

I have a smart contract that has a multi-index table called reservations - account, time, date, entity. From the code I am trying to use get_table_rows to get all reservations related to a given ...