Open Vkutovoy92 opened 3 months ago
I see no instructions how to create new tables and it is not very clear how to create indixes, as example
mongo_api:command(afsts_mongo_master, #{<<"createIndexes">> => <<"merchants">>, <<"indexes">> => [#{<<"key">> => #{<<"public_key">> => 1}, <<"name">> => <<"id_public_key">>}]}, 1000)
Doesn't work
When I use old api with application:set_env(mongodb, use_legacy_protocol, true), And ok = mongo_api:ensure_index(?MASTER, CollectionName, Index)
it gives OK but doesn't create indexes and tables if it is not exist
I have figured out, it looks as mongo_api:command(afsts_mongo_master, {<<"createIndexes">>, <<"merchants">>, <<"indexes">>, [#{<<"key">> => #{<<"test_index_1">> => 1}, <<"name">> => <<"test_index_1">>}]}, 5000)
mongo_api:command(afsts_mongo_master, {<<"createIndexes">>, <<"merchants">>, <<"indexes">>, [#{<<"key">> => #{<<"test_index_1">> => 1}, <<"name">> => <<"test_index_1">>}]}, 5000)
I see no instructions how to create new tables and it is not very clear how to create indixes, as example
mongo_api:command(afsts_mongo_master, #{<<"createIndexes">> => <<"merchants">>, <<"indexes">> => [#{<<"key">> => #{<<"public_key">> => 1}, <<"name">> => <<"id_public_key">>}]}, 1000)
Doesn't work
When I use old api with application:set_env(mongodb, use_legacy_protocol, true), And ok = mongo_api:ensure_index(?MASTER, CollectionName, Index)
it gives OK but doesn't create indexes and tables if it is not exist