Index: library/mongodb/tests/nx-mongo.test =================================================================== diff -u -r64cdee65763cc97c7ae64f6b522c1dee4707ed6e -r788f2f577d21a28e0d6a05ca87562a507d929527 --- library/mongodb/tests/nx-mongo.test (.../nx-mongo.test) (revision 64cdee65763cc97c7ae64f6b522c1dee4707ed6e) +++ library/mongodb/tests/nx-mongo.test (.../nx-mongo.test) (revision 788f2f577d21a28e0d6a05ca87562a507d929527) @@ -96,7 +96,7 @@ ? {lsort [lmap p $persons {$p cget -name}]} "Gustaf Stefan" puts "\nProject members of nsf or gtat:" -? {llength [set persons [Person find all -cond {projects in {nsf gtat}}]]} 3 +? {llength [set persons [Person find all -cond {projects in {nsf gtat}} -orderby name]]} 3 ? {lsort [lmap p $persons {$p cget -name}]} "Franz Gustaf Stefan" puts "\nProject members working on both nsf and nxmongo:" @@ -115,6 +115,9 @@ ? {llength [set persons [Person find all -cond {age > 30}]]} 1 ? {lsort [lmap p $persons {$p cget -name}]} "Gustaf" +puts "\nFind persons with names matching regular expression /an/i (containing 'an', ignore case):" +? {llength [set persons [Person find all -cond {name ~ {an i}}]]} 2 +? {lsort [lmap p $persons {$p cget -name}]} "Franz Stefan" # # Define a special find method for "Person" named "oldies" by @@ -124,6 +127,7 @@ return [:find all -cond {age > 30}] } + # # Use the special find method #