PocketBase 数据库 icon

PocketBase 数据库

与 PocketBase 数据库进行交互

📄 记录 → ➕ 创建记录

AI-generated

Summary

Creates a new record in a specified PocketBase collection by mapping provided field names to values.

Inputs

  • collection (required) — The name of the collection to create the record in.
  • fields — A collection of fields to set. Each field consists of a name (selected from the collection's schema) and a value (string). JSON strings are parsed automatically.
  • options.expand — Comma-separated list of related record fields to expand (e.g., 'author,tags').

Output shape

A single record object containing the newly created data (including the system ID, created, and updated timestamps).

The operation returns the full record object. If the input contains multiple items, each item generates a separate record.

Examples

Example 1: Create a new user with email and role.

Select the 'users' collection, add field 'email' with value 'user@example.com', and field 'role' with value 'admin'.

Example 2: Create an item that includes a JSON string parsed to an array.

Add field 'tags' with value '["tag1", "tag2"]' (the node will parse this to an array).

Links

Discussion