I am trying to add secondary index to my table so I can use it to query for elements based on it. My struct looks like this:
struct [[eosio::table]] user
{
name userAccount; // user accountname - primary key
std::string userKey; // user random unique key
std::string userName; // user firstname
std::string userLastname; // user lastname
std::string userEmail; // user email
std::string userCity; // user city
std::string userMobile; // user mobilephone
std::string userCartype; // user cartype
uint64_t primary_key() const { return userAccount.value; }
std::string secondary_key() const { return userEmail; }
};
typedef multi_index<name("users"), user> users_table;.
So, the thing is, after I compile the contract and apply it to my account it says that there are no changes to the contract. Am I missing something ? Is there another way of getting user based on userEmail?
p.s The main purpouse of this is to use rpc.get_table_rows in order to retrieve the user info based on the userEmail.