Skip to content

Commit 8f35e31

Browse files
line-oduncdrum
authored andcommitted
doc(readme): add db.collections.exists
1 parent b76805e commit 8f35e31

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

readme.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,19 @@ db.collections.describe(collectionPath)
359359
db.collections.read(collectionPath)
360360
```
361361

362+
#### exists
363+
364+
This function checks if the collection exists.
365+
366+
- returns `true` if the collection exists and the current user can open it
367+
- returns `false` if the collection does not exist
368+
- throws an exception if the collection exists but the current user cannot
369+
access it
370+
371+
```js
372+
db.collections.exists(collectionPath)
373+
```
374+
362375
#### existsAndCanOpen
363376

364377
This function checks if the collection exists and if it does, if the current user can access it.

0 commit comments

Comments
 (0)