Back to Yugabyte Db

Collection Management

src/postgres/third-party-extensions/documentdb/docs/v1/collection-management.md

2026.1.0.0-b29915 B
Original Source

Collection management

We can review for the available collections and databases by querying documentdb_api.list_collections_cursor_first_page.

sql
SELECT * FROM documentdb_api.list_collections_cursor_first_page('documentdb', '{ "listCollections": 1 }');

documentdb_api.list_indexes_cursor_first_page allows reviewing for the existing indexes on a collection. We can find collection_id from documentdb_api.list_collections_cursor_first_page.

sql
SELECT documentdb_api.list_indexes_cursor_first_page('documentdb','{"listIndexes": "patient"}');

ttl indexes by default gets scheduled through the pg_cron scheduler, which could be reviewed by querying the cron.job table.

sql
select * from cron.job;