(defn get-accounts [uname] (let [m (str "function(){ if( (this.content[1].content != null) && (this.owner == '"uname"') ) { this.content[1].content.forEach( function(x) { emit( this.owner , x ); } ); } };") r "function(k,vals) { return { result : vals } ; }" result (map-reduce :bookkeeping m r :result-collection)] (println (str "-- commands.get-accounts[" (first result) "]")) (vec (map bkell.domain/keywordize-tags (-> result first :value :result))) ;; dig in and get the currency list ) ) (defn get-entries [uname] (let [m (str "function(){ if( (this.content[2].content[0].content[0].content != null) && (this.owner == '"uname"') ) { this.content[2].content[0].content[0].content.forEach( function(x) { emit( this.owner , x ); } ); } };" ) r "function(k,vals) { return { result : vals } ; }" result (map-reduce :bookkeeping m r :result-collection)] (println (str "-- commands.get-entries[" (first result) "]")) (vec (map bkell.domain/keywordize-tags (-> result first :value :result))) ;; dig in and get the currency list ) )