You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ENG-959: Update docs to encourage using explorer for creating collections (#102)
* Update get-started.mdx
Added this video to show them how to create a simple collection using Explorer to encourage users to use Explorer.
* Update get-started.mdx
I have taken it off from Getting Started as you mentioned. Will now add it over to the Collections and add a new pull request for the same.
* Update collections.mdx
Moved over the SDK Collections code to the Collections section. Let me know if there are any more changes here to be made.
* Created a new heading for Creating Collections Programmatically
* Made the necessary changes as you had mentioned.
* Made a small change to the doc
* Split sections on creating collection
---------
Co-authored-by: Shaki <[email protected]>
Co-authored-by: Shaki150697 <[email protected]>
Copy file name to clipboardExpand all lines: collections.mdx
+47-6Lines changed: 47 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -18,14 +18,55 @@ action.
18
18
19
19
## Create a collection
20
20
21
-
You can create a collection using the [Explorer](https://explorer.testnet.polybase.xyz)**(recommended)** or by using the client library and calling the `applySchema` method on your polybase instance.
21
+
### Create collection using the Explorer(recommended)
22
22
23
-
<Info>
24
-
We recommended you use [Polybase
25
-
Explorer](https://explorer.testnet.polybase.xyz) to create your Collection. You will need to first login
26
-
and create an account.
27
-
</Info>
23
+
Navigate to the [Explorer](https://explorer.testnet.polybase.xyz), and click on "Create Collection". You will then be prompted to sign in.
24
+
25
+
If you create a collection in the explorer, the collection will be owned by the account you used to sign in.
26
+
27
+
28
+
### Create collection programmatically
29
+
30
+
To create a schema programatically, you can use the `applySchema` method on your Polybase client instance.
31
+
32
+
In this example, we create a collection called `City` that has `name` and `country` fields, and a `setCountry()` function. You can define multiple collections in a single `applySchema` call.
Copy file name to clipboardExpand all lines: get-started.mdx
+11-4Lines changed: 11 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -49,13 +49,18 @@ const db = polybase.Polybase({
49
49
50
50
## Create a collection
51
51
52
-
Create collections using [Polybase Explorer](https://explorer.testnet.polybase.xyz) or the JavaScript SDK.
52
+
Create collections using [Polybase Explorer](https://explorer.testnet.polybase.xyz) or the JavaScript SDK (`@polybase/client`).
53
+
54
+
Watch Shaki create a simple collection using the Polybase Explorer.
55
+
<iframe width="560" height="315" src="https://www.youtube.com/embed/EKHD7i1y4jc" title="Defining a collection in Polybase Explorer" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>
53
56
54
57
<Info>
55
58
We suggest creating collections using [Polybase Explorer](https://explorer.testnet.polybase.xyz). You will need to first login and create an account.
56
59
</Info>
57
60
58
-
A Polybase collection describes the rules for a collection of data, not just a single record (as is the case with other smart collection languages).
61
+
## Create a collection programmatically
62
+
63
+
If you want to create your collection programatically, see [Creating collection with applySchema](/collections#).
59
64
60
65
In this example we use the JavaScript SDK to create a collection called `City` that has `name` and `country` fields, and a `setCountry()` function. You can define multiple
61
66
collections in a single `applySchema` call.
@@ -93,7 +98,9 @@ await db.applySchema(`
93
98
); // your-namespace is optional if you have defined a default namespace
94
99
```
95
100
96
-
For more details on creating collections, see the [collection](/collections) overview.
101
+
You can create a collection using the [Explorer](https://explorer.testnet.polybase.xyz) **(recommended)** or by using the client library and calling the `applySchema` method on your polybase instance.
102
+
103
+
A Polybase collection describes the rules for a collection of data, not just a single record (as is the case with other smart collection languages).
97
104
98
105
## Create a collection record
99
106
@@ -149,4 +156,4 @@ const data = await db.collection("City").record("new-york").get();
149
156
</Card>
150
157
151
158
<Card title="Read the Polybase Whitepaper" icon="file-lines" href="https://polybase.xyz/whitepaper">
0 commit comments