These are chat archives for synrc/n2o

29th
Jan 2016
Ram Kumar
@ramka001
Jan 29 2016 09:15
doesn't kvs:index use table, key and value which is narrowing the search like kvs:index(users, Email, "john.doe@gmail.com")
Namdak Tonpa
@5HT
Jan 29 2016 09:28
kvs use mnesia
mnesia has index_read/3
index_read is able to query only by one field
Ram Kumar
@ramka001
Jan 29 2016 09:29
This message was deleted
Ram Kumar
@ramka001
Jan 29 2016 10:23

Hi @5HT , I'm getting n2o_nitrogen:Catch: exit:{aborted,{bad_type,{{2016,1,29},{18,13,32}}}} exception when I use kvs:add to store a value for date. This is the record

-ifndef(CHRONOLOGY_USERS_HRL).
-define(CHRONOLOGY_USERS_HRL, true).

-record(chronology_users, {id, username, date_joined, last_logged_in }).

-endif.

If I modify it to

-include_lib("kvs/include/kvs.hrl").

-ifndef(CHRONOLOGY_USERS_HRL).
-define(CHRONOLOGY_USERS_HRL, true).

-ifndef(CHRONOLOGY_USERS_EXT).
-define(CHRONOLOGY_USERS_EXT, username).
-endif.

-record(chronology_users, {?ITERATOR(feed, true), ?CHRONOLOGY_USERS_EXT, date_joined, last_logged_in }).

-endif.

it works. But I don't have need for the feed in the Iterator. Any idea why this could be happenining?

Namdak Tonpa
@5HT
Jan 29 2016 11:37
any object you want to add with kvs:add need to be an iterator
KVS is a framework of storing Iterators and Containers
Ram Kumar
@ramka001
Jan 29 2016 14:16
ok, got it