Skip to main content

Import

Import documents into collection

Synopsis

Imports documents into the collection. Input is a stream or array of JSON documents to import.

Automatically:

  • Detect the schema of the documents
  • Create collection with inferred schema
  • Evolve the schema as soon as it's backward compatible
tigris import {collection} {document}...|- [flags]

Examples


tigris import --project=myproj users --primary-key=id \
'[
{"id": 20, "name": "Jania McGrory"},
{"id": 21, "name": "Bunny Instone"}
]'

Options

  -a, --append                   Force append to existing collection
--autogenerate strings Comma separated list of autogenerated fields (only top level keys supported)
-b, --batch-size int32 set batch size (default 100)
--branch string Specifies branch: --branch=my_br1
--cleanup-null-values Remove NULL values and empty arrays from the documents before importing (default true)
--csv-comment string CSV comment
--csv-delimiter string CSV delimiter
--csv-trim-leading-space Trim leading space in the fields (default true)
--detect-byte-arrays Try detect byte arrays fields
--detect-integers Try detect integer fields (default true)
--detect-times Try detect date time fields (default true)
--detect-uuids Try detect UUID fields (default true)
-h, --help help for import
-d, --inference-depth int32 Number of records in the beginning of the stream to detect field types. It's equal to batch size if not set
--no-create-collection Do not create collection automatically if it doesn't exist
--primary-key strings Comma separated list of field names which constitutes collection's primary key (only top level keys supported)
-p, --project string Specifies project: --project=my_proj1

SEE ALSO

  • tigris - tigris is a command line interface of Tigris data platform