all repos — litestore @ 1fdbc0f9c801c519e14da24ba4b91c0f82445323

A minimalist nosql document store.

Fixed response for POST/PUT requests.
h3rald h3rald@h3rald.com
Fri, 22 May 2015 22:37:05 +0200
commit

1fdbc0f9c801c519e14da24ba4b91c0f82445323

parent

e84985979d268cb49f39fa2987365c749fe7e0f1

1 files changed, 5 insertions(+), 3 deletions(-)

jump to
M lib/utils.nimlib/utils.nim

@@ -98,17 +98,19 @@ var res = newSeq[tuple[key: string, val: JsonNode]](0)

var count = 0 for s in cols: var key = s + count.inc + if key == "searchable" or key == "binary" or key == "content_type": + continue if s.contains(" "): # documents.id AS id... let chunks = s.split(" ") key = chunks[chunks.len-1] var value:JsonNode - if doc[count] == "": + if doc[count-1] == "": value = newJNull() else: - value = %doc[count] + value = %doc[count-1] res.add((key, value)) - count.inc res.add(("tags", %tags)) return %res