Hi :) can you check if you have the "MongoQueries" package installed? cheers, Esteban ps: please notice that in anycase you will not be able to execute [ :each | each name first = $X ] because the MongoQueries package just translates the block into a mongo-query which is a dictionary (a JSON expression). But you will found some ways to help you, some special keywords like #in: and #where: (you can see how they work in the tests) On Jul 4, 2013, at 2:17 PM, Bernat Romagosa <tibabenfortlapalanca@gmail.com> wrote:
Hi!
I realize probably only Esteban will be able to answer, but I prefer to write to the list so the mail is logged and other people can benefit from it.
I'm trying to use blocks as arguments for #selectOne: and #selectMany:, but it doesn't seem to work. Here's my code:
MyClass selectOne: { #name -> 'Some name' } asDictionary. MyClass selectOne: [ :each | each name = 'Some name' ].
The first one works, but the second one raises a VOMongoConnectionError.
Also:
MyClass selectMany: { #name -> 'Some name' } asDictionary. MyClass selectMany: [ :each | each name = 'Some name' ].
The first does work, the second one doesn't, which prevents me from writing more useful stuff like:
MyClass selectMany: [ :each | each name first = $P ].
Any idea why this could be failing? I've the latest stable version loaded via:
Gofer it url: 'http://smalltalkhub.com/mc/estebanlm/Voyage/main'; package: 'ConfigurationOfVoyageMongo'; load. (Smalltalk at: #ConfigurationOfVoyageMongo) load.
Thanks! :)
Bernat.
-- Bernat Romagosa.