content — コンテンツ
テーブルのコンテンツを操作します。テーブル名は orizm.config.ts で定義したものです。
すべて認証とプロジェクトコンテキストが必要です。コンテンツのスキーマはテーブルごとに異なるため、出力は整形した JSON で表示されます。
orizm content list
テーブルのコンテンツ一覧を取得します。
orizm content list <table> [--filter <json>] [--order <json>] [--limit <n>] [--offset <n>]引数
| 引数 | 説明 |
|---|---|
<table> | テーブル名。 |
オプション
| オプション | 説明 |
|---|---|
--filter <json> | フィルター式を JSON 文字列で指定します。 |
--order <json> | 並び順を JSON 文字列(オブジェクトまたは配列)で指定します。 |
--limit <n> | 取得件数。既定は 100。 |
--offset <n> | ページネーションのオフセット。既定は 0。 |
orizm content list article --filter '{"status":{"eq":"published"}}' --limit 20orizm content get
特定のコンテンツを取得します。
orizm content get <table> <id>引数
| 引数 | 説明 |
|---|---|
<table> | テーブル名。 |
<id> | コンテンツ ID。 |
orizm content create
コンテンツを作成します。
orizm content create <table> --data <json>引数
| 引数 | 説明 |
|---|---|
<table> | テーブル名。 |
オプション
| オプション | 説明 |
|---|---|
--data <json> | (必須)コンテンツの各フィールド。JSON 文字列、または @path/to/file.json でファイルを指定します。 |
orizm content create article --data '{"title":"Hello","body":"..."}'
orizm content create article --data @./article.jsonorizm content update
コンテンツを更新します。
orizm content update <table> <id> --data <json>引数
| 引数 | 説明 |
|---|---|
<table> | テーブル名。 |
<id> | コンテンツ ID。 |
オプション
| オプション | 説明 |
|---|---|
--data <json> | (必須)更新する各フィールド。JSON 文字列、または @path/to/file.json。 |
orizm content delete
コンテンツを削除します。
orizm content delete <table> <id> [--yes]引数
| 引数 | 説明 |
|---|---|
<table> | テーブル名。 |
<id> | コンテンツ ID。 |
オプション
| オプション | 説明 |
|---|---|
--yes | 確認プロンプトをスキップします。 |
Last updated on