Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add missing :mongo parameter #20

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/bson-decode.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
3 changes: 2 additions & 1 deletion src/db.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
6 changes: 3 additions & 3 deletions src/shell.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down