Export Data
Exports documents into a file.
Command
# local game data (windows)
Charon.exe DATA EXPORT --dataBase "c:\my app\gamedata.json" --schemas Character --output "c:\my app\characters.json" --outputFormat json
# remote game data
Charon.exe DATA EXPORT --dataBase "https://charon.live/view/data/My_Game/develop/" --schemas Character --output "./characters.json" --outputFormat json --credentials "<API-Key>"
Parameters
- --dataBase
Absolute or relative oath to game data. Use quotation marks if your path contains spaces.
# local file --dataBase "c:\my app\gamedata.json" # remote server --dataBase "https://charon.live/view/data/My_Game/develop/"
- --credentials
The API key used to access remote server in case of –dataBase being URL.
- --schemas
A list of types of documents (schemas) to export. By default all schemas EXCEPT metadata are exported.
Use space to separate multiple schemas.
You can use wildcards (*) at the beginning and end of names.
You can use identifiers in {} instead of names.
You can exclude certain names by using an exclamation mark (!) at the beginning of their names.
# schema name --schemas Character --schemas Character Item # all (default) --schemas * # masks --schemas Char* --schemas *Modifier --schemas *Mod* # schema id --schemas {18d4bf318f3c49688087dbed} # negation --schemas Char* !Character --schemas !*Item*
- --properties
A list of properties or property types to export. By default all properties are exported.
Id property always included
Use space to separate multiple properties.
You can use wildcards (*) at the beginning and end of names.
You can use identifiers in {} instead of names.
You can exclude certain names by using an exclamation mark (!) at the beginning of their names.
You can use data type in [] instead of names.
- --languages
List of languages to keep in exported data. Language’s english name is used or language tag (BCP 47).
Use DATA I18N LANGUAGES to get list of used languages.
Use space to separate multiple languages
You can use wildcards (*) at the beginning and end of names.
You can use LCID or CultureInfo.Name in {} instead of the name.
You can exclude certain names by using an exclamation mark (!) at the beginning of their names.
# language tag (BCP 47) --languages {en-US} # language name --languages "Spanish (Spain)" # language name mask --languages Spanish* # language LCID --languages {3082} # negation and masks --languages !Spanish* --languages Spanish* !{es-Es}
- --mode
Export mode controls stripping and inclusion rules for exported data.
# (default) --mode normal --mode publication --mode extraction --mode localization
- normal
Export all specified documents defined in –schemas. This mode ensures that the exported graph of documents remains valid by including any necessary additional documents to avoid any broken references.
- publication
Same as –mode normal, but all non-essential data will be stripped. The result of the export can be safely loaded within the game with the generated code.
- extraction
Export only the specified –schemas without exporting any referenced documents. In this mode, the exported graph of documents may contain broken references. It is recommended to use the import –mode safeupdate when importing this data back.
- localization
Same as –mode extraction but only
LocalizedText
properties are exported.
- --output
Path to a exported data file. If the file exists, it will be overwritten. The directory must already exist. Alternatively, you can output to Standard Error, Standard Output, /dev/null, or a URL.
# standart output (default) --output out --output con # standart error --output err # null device --output null # absolute path (windows) --output "c:\my app\document.json" # absolute path (unix) --output /user/data/document.json # relative path (universal) --output "./document.json" # remote location (HTTP) --output "http://example.com/document.json" # remote location with authentication (FTP) --output "ftp://user:password@example.com/document.json"
- --outputFormat
Format of exported data.
# JSON (default) --outputFormat json # BSON --outputFormat bson # Message Pack --outputFormat msgpack # XML --outputFormat xml # XLSX Spreadsheet --outputFormat xlsx
- --outputFormattingOptions
Additional options for specified format.
This command supports universal parameters.
Output Data Schema
The expored data follow this schema:
{ "Collections": { "<Schema-Name>": [ { // <Document> }, // ... ] } }