Skip to content

Commit e5e037e

Browse files
authored
chore: fix import format doc (#203)
1 parent 4cad995 commit e5e037e

1 file changed

Lines changed: 11 additions & 88 deletions

File tree

‎docs/imports.md‎

Lines changed: 11 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -9,98 +9,21 @@ for processing.
99

1010
### Validation
1111

12-
To import data into your Stream app, you'll need to provide a valid import file. The file needs to be structured as a
13-
list of JSON objects, representing each item to be imported.
12+
To import data into your Stream app, you'll need to provide a valid import file. The file needs to be structured as
13+
newline-delimited JSON (JSONL): one JSON object per line, each wrapping a single item to be imported under a `data` key.
1414

1515
<details markdown="1">
1616
<summary>Here's an example of a valid import file</summary>
1717

18-
```json
19-
[
20-
{
21-
"type": "user",
22-
"item": {
23-
"id": "hannibal",
24-
"role": "user",
25-
"teams": [
26-
"A-team"
27-
],
28-
"channel_mutes": [
29-
"messaging:HQ"
30-
]
31-
}
32-
},
33-
{
34-
"type": "user",
35-
"item": {
36-
"id": "murdock",
37-
"role": "user",
38-
"teams": [
39-
"A-team"
40-
],
41-
"push_notifications": {
42-
"disabled": true,
43-
"disabled_reason": "doesn't want to be disturbed"
44-
},
45-
"user_mutes": [
46-
"hannibal"
47-
]
48-
}
49-
},
50-
{
51-
"type": "channel",
52-
"item": {
53-
"id": "HQ",
54-
"type": "messaging",
55-
"team": "A-team",
56-
"created_by": "hannibal"
57-
}
58-
},
59-
{
60-
"type": "member",
61-
"item": {
62-
"channel_id": "HQ",
63-
"channel_type": "messaging",
64-
"user_id": "hannibal"
65-
}
66-
},
67-
{
68-
"type": "member",
69-
"item": {
70-
"channel_id": "HQ",
71-
"channel_type": "messaging",
72-
"user_id": "murdock"
73-
}
74-
},
75-
{
76-
"type": "message",
77-
"item": {
78-
"id": "message1",
79-
"channel_id": "HQ",
80-
"channel_type": "messaging",
81-
"user": "hannibal",
82-
"text": "I love it when a plan comes together"
83-
}
84-
},
85-
{
86-
"type": "reaction",
87-
"item": {
88-
"message_id": "message1",
89-
"type": "like",
90-
"user_id": "murdock",
91-
"created_at": "2022-01-01T01:01:01Z"
92-
}
93-
},
94-
{
95-
"type": "device",
96-
"item": {
97-
"id": "deviceID",
98-
"user_id": "hannibal",
99-
"created_at": "2022-01-01T01:01:01Z",
100-
"push_provider_type": "firebase"
101-
}
102-
}
103-
]
18+
```jsonl
19+
{"type": "user", "data": {"id": "hannibal", "role": "user", "teams": ["A-team"], "channel_mutes": ["messaging:HQ"]}}
20+
{"type": "user", "data": {"id": "murdock", "role": "user", "teams": ["A-team"], "push_preferences": {"chat_level": "none"}, "user_mutes": ["hannibal"]}}
21+
{"type": "channel", "data": {"id": "HQ", "type": "messaging", "team": "A-team", "created_by": "hannibal"}}
22+
{"type": "member", "data": {"channel_id": "HQ", "channel_type": "messaging", "user_id": "hannibal"}}
23+
{"type": "member", "data": {"channel_id": "HQ", "channel_type": "messaging", "user_id": "murdock"}}
24+
{"type": "message", "data": {"id": "message1", "channel_id": "HQ", "channel_type": "messaging", "user": "hannibal", "text": "I love it when a plan comes together"}}
25+
{"type": "reaction", "data": {"message_id": "message1", "type": "like", "user_id": "murdock", "created_at": "2022-01-01T01:01:01Z"}}
26+
{"type": "device", "data": {"id": "deviceID", "user_id": "hannibal", "created_at": "2022-01-01T01:01:01Z", "push_provider_type": "firebase"}}
10427
```
10528
</details>
10629

0 commit comments

Comments
 (0)