From 56bad90e732e4e0f5de9e649c49f5138d517bc78 Mon Sep 17 00:00:00 2001 From: Sascha Matzke Date: Fri, 24 Apr 2009 09:32:00 +0200 Subject: [PATCH] fixed collection problem (query) --- mongodb/driver/driver.factor | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mongodb/driver/driver.factor b/mongodb/driver/driver.factor index 02b2f1b7c8..d488dcc872 100644 --- a/mongodb/driver/driver.factor +++ b/mongodb/driver/driver.factor @@ -120,6 +120,9 @@ MEMO: check-collection ( collection -- fq-collection ) [ [ (ensure-collection) ] keep ] unless [ mdb-instance name>> ] dip "%s.%s" sprintf ; inline +: fix-query-collection ( mdb-query -- mdb-query ) + [ check-collection ] change-collection ; inline + PRIVATE> : ( collection query -- mdb-query ) @@ -151,7 +154,7 @@ M: mdb-cursor get-more ( mdb-cursor -- mdb-cursor objects ) GENERIC: find ( mdb-query -- cursor result ) M: mdb-query-msg find - send-query ; + fix-query-collection send-query ; M: mdb-cursor find get-more ; @@ -161,6 +164,7 @@ M: mdb-query-msg explain. GENERIC: find-one ( mdb-query -- result/f ) M: mdb-query-msg find-one + fix-query-collection 1 >>return# send-query-plain objects>> dup empty? [ drop f ] [ first ] if ;