2016-10-12 67 views

回答

1

檢查this文檔有關RethinkDB二級指標。

您可以在表中獲取所有索引列表(例如「用戶」)使用此查詢:

r.table("users").index_list() 

如果你想獲得的所有輔助索引的所有表,您可以查詢表列表中,之後獲取每個索引。我不知道蟒蛇,但在Java腳本,您可以使用此查詢做到這一點:

r.tableList().map(function(table){ 
    return {table: table, 
    indexes: r.table(table).indexList()}; 
}) 

我認爲,在蟒蛇它看起來像這樣:

r.table_list().map(lambda name:{table: name,indexes: r.table(name).index_list()}) 
+0

正是我需要的。作爲參考,'index_list()'的文檔位於[https://www.rethinkdb.com/api/python/index_list/](https://www.rethinkdb.com/api/python/index_list/)。 –

相關問題