Skip to content

Commit a2ec3de

Browse files
committed
Improve readme example
1 parent 1de4cd1 commit a2ec3de

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,21 @@
11
# @datastax/astra-db-ts
22

3+
`astra-db-ts` is a TypeScript client for interacting with [DataStax Astra DB](https://astra.datastax.com/signup).
4+
35
## Getting Started
46

57
```typescript
68
import { AstraDB } from "@datastax/astra-db-ts";
79

8-
const { TOKEN, DATABASE_ID, REGION, COLLECTION_NAME } = process.env;
10+
const { TOKEN, DATABASE_ID, REGION, COLLECTION_NAME, ENDPOINT } = process.env;
911

1012
const astraDb = new AstraDB(TOKEN, DATABASE_ID, REGION);
13+
// or...
14+
// const astraDb = new AstraDB(TOKEN, ENDPOINT);
15+
16+
// Create a collection
1117
const collection = await astraDb.collection(COLLECTION_NAME);
18+
19+
// Return the number of documents in the collection
1220
const results = await collection.countDocuments();
1321
```

0 commit comments

Comments
 (0)