Skip to content

Commit

Permalink
[core] Improve sanity dataset import documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
rexxars committed Apr 9, 2018
1 parent 37bc881 commit 7c18827
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions packages/@sanity/core/src/commands/dataset/importDatasetCommand.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,26 @@ Options
--replace On duplicate document IDs, replace existing document with imported document
Examples
# Import "moviedb.ndjson" from the current directory to the dataset called "moviedb"
sanity import moviedb.ndjson moviedb
sanity import moviedb.ndjson moviedb --replace
# Import "moviedb.tar.gz" from the current directory to the dataset called "moviedb",
# replacing any documents encountered that have the same document IDs
sanity import moviedb.tar.gz moviedb --replace
# Import from a folder containing an ndjson file, such as an extracted tarball
# retrieved through "sanity dataset export".
sanity import ~/some/folder moviedb
# Import from a remote URL. Will download and extract the tarball to a temporary
# location before importing it.
sanity import https://some.url/moviedb.tar.gz moviedb --replace
`

export default {
name: 'import',
group: 'dataset',
signature: '[FILE] [TARGET_DATASET]',
signature: '[FILE | FOLDER | URL] [TARGET_DATASET]',
description: 'Import documents to given dataset from ndjson file',
helpText,
action: async (args, context) => {
Expand Down

0 comments on commit 7c18827

Please sign in to comment.