Hi David,

The documentation for the mongoCollectionFind function is here http://www.openbd.org/manual/?/function/mongocollectionfind and it looks like you have missed a parameter to keep things in order, I believe this should fix it:

<cfset results = MongoCollectionFind("mongo", "mycoll", {age: {"$gte": 40}}, {}, 0, 10) />

The first structure is the "where" arguments, and the second structure would be fields you wish to bring back, but since you want all of them you should be able to pass a blank structure for that.

For your second question I think you may just need to register 2 mongo datasources, as that is what currently defines the database to use. I dont think that assignment can be changed on the fly BUT you could simply delete old datasources when you no longer need them and create new ones:

http://www.openbd.org/manual/?/function/mongoregister
http://www.openbd.org/manual/?/function/mongoderegister

Jamie MacDonald.



On 04/01/2012 13:57, David Mulder wrote:
Experimenting with mangodb quickly gave me an error page without any specific error message (see attachment (the code is visible in the attachment as well)). Anybody any idea what's wrong with it?

(And a second question, how can you use the "use databasename" command from coldfusion, because I want to login (on development at least) with an admin user, but the admin user is (if I understand is correctly) specific for the admin database and can next write to all other databases, so I need to login on the admin database first and next switch to another one.)

 David Mulder



--
aw2.0
  http://www.aw20.co.uk/

--
online documentation: http://openbd.org/manual/
  google+ hints/tips: https://plus.google.com/115990347459711259462
    http://groups.google.com/group/openbd?hl=en

    Join us @ http://www.OpenCFsummit.org/ Dallas, Feb 2012

Reply via email to