tencent cloud

TencentDB for TcaplusDB

Release Notes
Product Introduction
Product Overview
Benefits
Use Cases
Architecture
Regions
Purchase Guide
Product Pricing
Payment Overdue
Getting Started
Basic Concepts
Creating Cluster
Creating Table Group
Creating Table
Get Connection Information
Accessing TcaplusDB
Operation Guide
Managing Cluster and Table Group
Managing Table
Monitoring and Alarming
Access Management
Tag
Task List
TcaplusDB Client
Accessing by Client Tool
Client Tool Commands
TcaplusDB SDK
Release History
SDK Download
C++ SDK API
TcaplusDB Error Codes
SDK Installation
Directions for Protobuf Table SDK for C++
Directions for TDR Table SDK for C++
TcaplusDB RESTful APIs
Description
Go
Java
PHP
Python
Downloading RESTful API Samples in Multiple Languages
Practical Tutorial
Best Practice for Table Structure Design
Best Practice for Database Interaction
FAQs
Database Features
Database Use
Database Principles
API Documentation
History
Introduction
API Category
Making API Requests
Table Group APIs
Other APIs
Table APIs
Cluster APIs
Data Types
Error Codes
Service Agreement
Service Level Agreement
Terms of Service
Glossary
Contact Us

getttl

PDF
포커스 모드
폰트 크기
마지막 업데이트 시간: 2024-12-04 10:12:05

Overview

This command is used to query the Time to Live (TTL) in millisecond of a record. After a record is configured with TTL, you can use getttl to query the TTL of its key, that is, how long it is until the key is removed due to expiration. This command can query the TTL of only one record.

Syntax

getttl from [table] where key1 = 1 and key2 = "abc";

Parameters

Parameter
Required
Use Limits
Description
table
Yes
None
Table name
key in the WHERE clause
Yes
TDR table: all key values are required
Specify the value of a key. Multiple values are separated with and.

Errors

For more information, please see Error Codes.

Return Messages

Situation
Return Message
The key does not exist or has expired.
Record does not exist or has expired.
The key exists but its TTL is not specified.
Record exists and no expiration time is set (permanent).
Failed to query the TTL.
Failed to get time to live. The error code is [error code] and the error message is [Error message].
Queried the TTL successfully.
The time to live is [TTL] milliseconds.

Sample

Query the TTL of a record:
tcaplus> getttl from mails where key1 = 1 and key2 = "abc";
The time to live is 2000 milliseconds.

도움말 및 지원

문제 해결에 도움이 되었나요?

피드백