Skip to content

Commit cefc234

Browse files
Update Collections.php
Added exists method
1 parent 0ba31dc commit cefc234

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

src/Endpoints/Collections.php

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,19 @@ public function info(): Response
6464
);
6565
}
6666

67+
/**
68+
* # Collection exists
69+
* Checks whether the specified collection exists.
70+
*
71+
* @throws InvalidArgumentException
72+
*/
73+
public function exists(): Response
74+
{
75+
return $this->client->execute(
76+
$this->createRequest('GET', '/collections/' . $this->getCollectionName(). '/exists')
77+
);
78+
}
79+
6780
/**
6881
* # Delete collection
6982
* Drop collection and all associated data
@@ -121,4 +134,4 @@ public function cluster(): Cluster
121134
{
122135
return (new Cluster($this->client))->setCollectionName($this->collectionName);
123136
}
124-
}
137+
}

0 commit comments

Comments
 (0)