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

setttl

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

Overview

This command is used to set a time to live (TTL) in millisecond for a record. The set value will be reduced by the elapsed time. When the TTL value of a record is equal to 0, TcaplusDB will remove it. This command only takes effect on a single record.

Syntax

setttl [table] ttl=[TTL] where key1 = 1 and key2 = "abc";

Parameters

Parameter
Required
Limit
Description
table
Yes
No
Table name
TTL
Yes
The value cannot exceed half of the maximum value of uint64\\_t. In other words, the maximum TTL value is ULONG_MAX/2. A value exceeded this limit will be set to the maximum value.
Time to live in millisecond
Key in the WHERE clause
Yes
All key values are required for TDR table.
Key values need to be declared. Multiple key values are joined with and.

Errors

For more information, see Error Codes.

Return Messages

Situation
Return Message
The record does not exist or has expired.
Record does not exist or has expired.
Failed to set time to live.
Failed to set time to live. The error code is [error code] and the error message is [Error message].
Set time to live successfully.
Set time to live successfully.

Sample

Set TTL to 2,000 milliseconds:
tcaplus> setttl mails ttl=2000 where key1 = 1 and key2 = "abc";
Set time to live successfully.

도움말 및 지원

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

피드백