Hi! I'm quite new to ColdFusion and new in MongoDB too, so I would really appreciate a bit of help.
In first place, I have to thank you for the development of this fantastic library. I don't know what I would have done without it.
I have to make a query using the logical $or operator. I have managed to have it working on the mongo shell, however, I couldn't move it to CFMongoDB. This is the original query I had running in SQL Server:
SELECT * FROM history WHERE (userid = 1 OR ip = '127.0.0.1') AND date < GETDATE()
And this is the query that I managed to have working on my mongo shell:
db.history.find({$or : [{'USERID':1}, {'IP':'127.0.0.1'}], 'DATE':{$lt:new Date()}})
The problem is that I am being unable to have this previous query running with CFMongoDB. Here is my attempt:
application.mongo.getDBCollection('history').query()
.$or([{'USERID':1}, {'IP':'127.0.0.1'}])
.$lt({'DATE':Now()})
.find().asArray();
And this is the error that I'm getting:
The method $or was not found in component /Applications/ColdFusion10/cfusion/wwwroot/inc/cfmongodb/core/SearchBuilder.cfc.
Any idea of why is this not working?