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

problem with query-view, yason and complex keys. #15

Open
jimhansson opened this issue Jun 5, 2018 · 0 comments
Open

problem with query-view, yason and complex keys. #15

jimhansson opened this issue Jun 5, 2018 · 0 comments

Comments

@jimhansson
Copy link

jimhansson commented Jun 5, 2018

;;I have a db like this
(defparameter *couch* (make-instance 'chillax:yason-server
							 :host "127.0.0.1"
							 :username *db-user*
							 :password *db-pass*
							 :object-as-alist-p t
							 :parse-object-key-fun (lambda (string) (intern string *package*))))

;;and when i try to do query-view where I have a key that is an json array and doing grouping, i get an 
;;error if i dont change to this in yason.lisp
(defmethod data->json ((server yason-server) data &key)
  (with-output-to-string (s)
    (if (and (parse-object-as-alist-p server) ;; added the (and and the check to make sure we data is alist
						 (listp data)  
						 (listp (car data)))
        (yason:encode-alist data s)
        (yason:encode data s))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant