我对这个概念真的很陌生,我想在项目中使用这个API。
我应该如何在一个概念数据库中插入数据?我知道如何读取有关数据库的信息,我知道如何更新模式,我知道如何从数据库中检索数据,但我不知道如何在数据库中插入或删除数据。
谢谢。
发布于 2021-09-15 09:29:58
每个数据代表一个页面。因此,您希望将页面导入数据库。这里介绍了如何导入页面https://developers.notion.com/reference/post-page
exports.newEntryToDatabase = async function (name, description) {
const response = await notion.pages.create({
parent: {
database_id: process.env.NOTION_API_DATABASE,
},
properties: {
Name: {
title: [
{
text: {
content: name,
},
},
],
},
Description: {
rich_text: [
{
text: {
content: description,
},
},
],
},
},
});
return response;
};
https://stackoverflow.com/questions/69150120
复制