all repos — litestore @ e6cf182e446d75601dcd2060c075ca7e1fc5f132

A minimalist nosql document store.

Now allowing JSON indexes on stores containing mixed type items.
h3rald h3rald@h3rald.com
Thu, 04 Jun 2020 09:18:26 +0200
commit

e6cf182e446d75601dcd2060c075ca7e1fc5f132

parent

b22720e1358e0fade1f6009d1c52d20a81ea43ab

2 files changed, 1 insertions(+), 6 deletions(-)

jump to
M src/admin/md/api_indexes.mdsrc/admin/md/api_indexes.md

@@ -7,11 +7,6 @@ > This resource has been introduced in version 5 of the LiteStore API.

LiteStore Indexes are special indexes used to optimize the performance of queries on JSON documents. -> %warning% -> JSON-only Documents Required! -> -> Indexes can be created *only* if the entire database is composed by JSON documents. If not, LiteStore will return an error when attempting to create the first index. - #### OPTIONS indexes Returns the allowed HTTP verbs for this resource.
M src/litestorepkg/lib/core.nimsrc/litestorepkg/lib/core.nim

@@ -136,7 +136,7 @@

# Manage Indexes proc createIndex*(store: Datastore, indexId, field: string) = - let query = sql("CREATE INDEX json_index_$1 ON documents(json_extract(data, ?) COLLATE NOCASE)" % [indexId]) + let query = sql("CREATE INDEX json_index_$1 ON documents(json_extract(data, ?) COLLATE NOCASE) WHERE json_valid(data)" % [indexId]) store.begin() store.db.exec(query, field) store.commit()