File tree Expand file tree Collapse file tree 3 files changed +9
-9
lines changed Expand file tree Collapse file tree 3 files changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ describe("Astra", () => {
14
14
namespace : "test" ,
15
15
} ) ;
16
16
17
- const results = await astra . createCollection ( { collectionName : "blah" } ) ;
17
+ const results = await astra . createCollection ( { name : "blah" } ) ;
18
18
expect ( results . status . ok ) . to . equal ( 1 ) ;
19
19
} ) ;
20
20
@@ -27,7 +27,7 @@ describe("Astra", () => {
27
27
} ) ;
28
28
29
29
const results = await astra . createCollection ( {
30
- collectionName : "blah " ,
30
+ name : "blahs " ,
31
31
options : {
32
32
vector : {
33
33
size : 2 ,
@@ -58,7 +58,7 @@ describe("Astra", () => {
58
58
namespace : "test" ,
59
59
} ) ;
60
60
61
- const collection = await astra . deleteCollection ( "bah" ) ;
61
+ const collection = await astra . deleteCollection ( { name : "bah" } ) ;
62
62
expect ( collection . status . ok ) . to . equal ( 1 ) ;
63
63
} ) ;
64
64
} ) ;
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ import { expect } from "chai";
4
4
5
5
const { ASTRA_DB_TOKEN , ASTRA_DB_ID } = process . env ;
6
6
7
- describe . only ( "Collections" , ( ) => {
7
+ describe ( "Collections" , ( ) => {
8
8
describe ( "Namespaces" , ( ) => {
9
9
test ( "should create collection" , async ( ) => {
10
10
const astra = new Astra ( {
@@ -14,10 +14,10 @@ describe.only("Collections", () => {
14
14
namespace : "test" ,
15
15
} ) ;
16
16
17
- const results = await astra . createCollection ( { collectionName : "test" } ) ;
17
+ const results = await astra . createCollection ( { name : "test" } ) ;
18
18
const countResults = await astra
19
19
. collection ( "test" )
20
- . countDocuments ( "test" ) ;
20
+ . countDocuments ( ) ;
21
21
expect ( countResults . status . count ) . to . be . greaterThan ( 0 ) ;
22
22
} ) ;
23
23
} ) ;
Original file line number Diff line number Diff line change @@ -36,13 +36,13 @@ export class Collection {
36
36
this . apiConfig = args . apiConfig ;
37
37
}
38
38
39
- public countDocuments = async ( opts : CountDocumentsCommands ) => {
39
+ public countDocuments = async ( opts ? : CountDocumentsCommands ) => {
40
40
const response = await axios . post (
41
41
`${ this . apiConfig . base } /${ this . namespace } /${ this . collectionName } ` ,
42
42
{
43
43
countDocuments : {
44
- filter : opts . filter ,
45
- options : opts . options ,
44
+ filter : opts ? .filter ,
45
+ options : opts ? .options ,
46
46
} ,
47
47
} ,
48
48
this . apiConfig . requestOptions ,
You can’t perform that action at this time.
0 commit comments