UNPKG
dobo-elasticsearch
Version:
latest (2.0.1)
2.0.1
2.0.0
1.2.0
1.1.1
1.1.0
1.0.3
1.0.2
1.0.1
1.0.0
Elasticsearch driver for Dobo
github.com/ardhi/dobo-elasticsearch
ardhi/dobo-elasticsearch
dobo-elasticsearch
/
dobo
/
method
/
model
/
exists.js
10 lines
(7 loc)
•
267 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
async
function
modelExists
(
{ schema, options = {} }
) {
const
{ getInfo } =
this
.
app
.
dobo
const
{ instance } =
getInfo
(schema)
const
exists =
await
instance.
client
.
indices
.
exists
({
index
: schema.
name
})
return
!!exists }
export
default
modelExists