You can delete database records using the console or calling an API.
Prerequisites
Console operations
Log on to the EMAS Management Console. Select Serverless and then click Enter to open the Serverless console.
In the navigation pane on the left, click Cloud Database.
On the Cloud Database page, click the target data table.
On the Data tab, click Delete for the target record, and then click OK.
Cloud function invocation
Delete a single record.
mpserverless.db.collection('users') .deleteOne({ name: 'Tom' }) .then((res) => { const hasDeleted = res.affectedDocs > 0; }) .catch(console.error);Delete multiple records.
mpserverless.db.collection('users') .deleteMany({ age: {$lt: 18} }) .then((res) => { const hasDeleted = res.affectedDocs > 0; }) .catch(console.error);
该文章对您有帮助吗?