all repos — litestore @ 7bd66ed0e0de5ba8a55cb59b598aff01f8943168

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

7bd66ed0e0de5ba8a55cb59b598aff01f8943168

parent

aa4a88e1b0cae76cdc242c194db5e2d7b000bfab

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()