Permalink
Browse files

Merge pull request #6 from pnathan/master

Added routine to query a document for keys.
  • Loading branch information...
2 parents 90cfd35 + 6c8c7f6 commit b1d59004c4ff2703ccd344c7d3b4cf2b3da1c625 @fons committed Jan 12, 2012
Showing with 7 additions and 0 deletions.
  1. +6 −0 src/document.lisp
  2. +1 −0 src/packages.lisp
View
@@ -58,6 +58,12 @@ the document was generated by the client (as opposed to having been read from th
(push (doc-id document) lst))
lst))
+(defgeneric get-keys (document)
+ (:documentation "Gets a list of keys that are in the document"))
+(defmethod get-keys ((document document))
+ (loop for key being the hash-keys of (elements document)
+ collect key))
+
(defun get-all-values (key list-of-docs)
(let ((lst ()))
(dolist (doc list-of-docs)
View
@@ -17,6 +17,7 @@
:ht->document
:mapdoc
:doc-id
+ :get-keys
;;commands
:mongo

0 comments on commit b1d5900

Please sign in to comment.