1

Есть вторичный ключ site_id, нужно получить все записи по нему, но в документации aerospike ничего подобного не нашел. Хотя в самом aql используется просто bin = value;

2 ответа 2

1

(Assuming Google Translate properly translated your question :) )

If site_id is a number, you should be able to use the range query API. For strings, I don't think there is a direct way at this point... There are potential other ways to get all the keys with a specific bin, for example predexp filters on top of a scan, or maybe even defining a set for all those keys and using a scan. May not be as efficient, though.


(Перевод сообщества.)

Если site_id — число, то можно воспользоваться API range_query. Для строк, не думаю, что сейчас есть такая возможность... Есть пути получить ключи с определённым bin, например фильтры predexp в scan'е или может быть даже определить множество этих ключей и использовать scan. Правда, это не особо эффективно.

1

Мы нашли такую штуку как NewEqualFilter для драйвера golang. Работает с вторичными индексами как и нужно было.

2
  • Correct, the NewEqualFilter API is the correct Go API for finding where bin = value. Seems our Google Translator provided a different translation ¯\_(ツ)_/¯.
    – kporter
    15 окт 2019 в 21:21
  • 1
    By the way, assuming Translation goes better in the future, for API questions it would be helpful to also know which client language (c, java, go, ...) that you are using.
    – kporter
    15 окт 2019 в 21:23

Ваш ответ

By clicking “Отправить ответ”, you agree to our terms of service and acknowledge you have read our privacy policy.

Всё ещё ищете ответ? Посмотрите другие вопросы с метками или задайте свой вопрос.