elections-cpl.api.hscc.bdpa.org • Docs
elections-cpl.api.hscc.bdpa.org / lib/mongo-item / itemExists
itemExists<
T
>(collection
,id
,options
?):Promise
<boolean
>
Checks if an item matching { _id: id }
exists within collection
.
• T extends Document
• collection: Collection
<T
>
• id: string
| ObjectId
• options?: ItemExistsOptions
Promise
<boolean
>
itemExists<
T
>(collection
,descriptor
,options
?):Promise
<boolean
>
Checks if an item matching { [descriptor.key]: descriptor.id }
exists
within collection
.
• T extends Document
• collection: Collection
<T
>
• descriptor
• descriptor.id: string
| ObjectId
• descriptor.key?: string
• options?: ItemExistsOptions
Promise
<boolean
>