From eb00f33fa8a034c74e113b712f01071b400ad5df Mon Sep 17 00:00:00 2001 From: Sascha Matzke Date: Thu, 29 Jan 2009 13:49:18 +0100 Subject: [PATCH] removed findOne words, added new word nfind ( example n -- result ) which limits the number of results returned to n --- mongodb/mongodb.factor | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/mongodb/mongodb.factor b/mongodb/mongodb.factor index 96800d3d87..1d5d7f3693 100644 --- a/mongodb/mongodb.factor +++ b/mongodb/mongodb.factor @@ -8,7 +8,7 @@ IN: mongodb ! generic methods GENERIC: store ( tuple/ht -- ) GENERIC: find ( example -- tuple/ht ) -GENERIC: findOne ( exampe -- tuple/ht ) +GENERIC# nfind 1 ( example n -- tuple/ht ) GENERIC: load ( object -- object ) > master>> ] dip (find) build-result ; -M: mdb-persistent findOne ( example -- result ) - prepare-find [ mdb>> master>> ] dip (find-one) - dup returned#>> 1 = - [ objects>> first ] - [ drop f ] if ; +M: mdb-persistent nfind ( example n -- result ) + [ prepare-find ] dip >>return# + [ mdb>> master>> ] dip (find) + build-result ; +