Skip to content

Get table metadata api

  • Get table/collection columns details using get-table-meta-api system API.

Request Method: POST

URL

/api/system-api/user-path/get-table-meta

Request payload

  • Get single table/collection metadata.
{
    "instance": "instance_name",
    "database": "database_name",
    "collection": "table_name"
}
  • Get multiple table/collection meta data as same time.
[
    {
        "instance": "instance_name",
        "database": "database_name",
        "collection": "table_name"
    },
    {
        "instance": "instance_name",
        "database": "database_name",
        "collection": "table_name"
    }
]

Get table metadata System API

Get table metadata using global object 'g'.

1
2
3
4
5
await g.sys.system.getTableMeta({
    instance: 'INSTANCE_NAME',
    database: 'DATABASE_NAME',
    collection: 'COLLECTION_NAME'
});

API Response

{
    "success": true,
    "statusCode": 200,
    "data": [
        {
            "name": "column_name",
            "path": "column_path",
            "count": 14,
            "total_count": 24,
            "type": [
                "String",
                "Null"
            ],
            "has_duplicates": true,
            "probability": 1
        },
        {
            "name": "column_name",
            "path": "column_path",
            "count": 14,
            "total_count": 24,
            "type": "ObjectId",
            "has_duplicates": false,
            "probability": 1
        }
    ]
}