add createIndex
This commit is contained in:
parent
348d886cd4
commit
01b5c272c8
1 changed files with 2 additions and 0 deletions
|
|
@ -87,6 +87,8 @@ proc newMeili*(host, apiKey:string):Meili=
|
|||
host:parseUrl(host),
|
||||
apiKey:apiKey
|
||||
)
|
||||
proc createIndex*(meili:Meili, uid:string, primaryKey="id")=
|
||||
discard fetchc(meili, @["indexes"], "post", $(%* {"uid":uid, "primaryKey":primaryKey}))
|
||||
|
||||
proc getIndex*[T](meili:Meili, name:string):MeiliIndex[T]=
|
||||
let resp = meili.fetch([name])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue