From 22383f40d8f5713af36a9baba89236bbf7e9d6c8 Mon Sep 17 00:00:00 2001 From: Ury Marshak Date: Mon, 13 Jan 2014 12:04:24 +0200 Subject: [PATCH 1/2] add missing :mongo parameter --- src/db.lisp | 3 ++- src/shell.lisp | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/db.lisp b/src/db.lisp index f76fabd..eb854e1 100644 --- a/src/db.lisp +++ b/src/db.lisp @@ -278,7 +278,8 @@ Create an index specified by the keys in a collection (kv (kv "ns" (full-collection-name mongo collection)) (kv "key" (force-float index)) (spec-gen unique drop-duplicates) - (kv "name" (keys->name (ht->list index)))))))) + (kv "name" (keys->name (ht->list index)))) + :mongo mongo)))) (defmethod db.ensure-index ((collection string) (index kv-container) &key (mongo (mongo)) (unique nil) (drop-duplicates nil)) diff --git a/src/shell.lisp b/src/shell.lisp index 051cbcd..d0ccb36 100644 --- a/src/shell.lisp +++ b/src/shell.lisp @@ -4,10 +4,10 @@ shell commands |# -(defun docs (result) +(defun docs (result &key (mongo (mongo))) "Stop the iterator (if any) and return the list of documents returned by the query. -Typical ue would be in conjunction with db.find like so (docs (iter (db.find 'foo' 'll)))" - (cadr (db.stop result))) +Typical use would be in conjunction with db.find like so (docs (iter (db.find 'foo' 'll)))" + (cadr (db.stop result :mongo mongo))) (defun iter (result &key (mongo (mongo)) (max-per-call 0)) "Exhaustively iterate through a query. The maximum number of responses From fcda2e23935f10072dc3b9d02544e7cfc5d2c554 Mon Sep 17 00:00:00 2001 From: Ury Marshak Date: Mon, 17 Mar 2014 16:32:01 +0200 Subject: [PATCH 2/2] * src/bson-decode.lisp: BSON date has to be a signed int to work with dates before 1970 --- src/bson-decode.lisp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bson-decode.lisp b/src/bson-decode.lisp index 55825b1..6f5244f 100644 --- a/src/bson-decode.lisp +++ b/src/bson-decode.lisp @@ -74,7 +74,7 @@ (setf (gethash key ht) (byte-to-bool (elt array pos))) (incf pos 1)) ((= type +bson-data-date+) - (setf (gethash key ht) (make-bson-time (octet-to-uint64.1 array pos))) + (setf (gethash key ht) (make-bson-time (octet-to-int64.1 array pos))) (incf pos 8)) ((= type +bson-data-null+) (setf (gethash key ht) nil))