-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issues with MongoDB 2.6 and CFMongoDB #46
Comments
@appdevjrcigars I haven't tried CFMongoDB with mongo 2.6 yet (I rarely work in CF anymore, alas). If you turn on profiling (db.setProfilingLevel(2)) to log all queries, do you see anything strange in there that would indicate why find() isn't returning results? |
Thanks for your prompt reply. Turning on profiling helped indeed to see why 0 results are being returned since it revealed that, no matter how hard I try, if I query on a string field (e.g. trandate) that contains a string with only numeric values (e.g. "20140702"), the translation of the query from CFMongoDB to mongodb is an integer value instead of string. So for example, the query db.find({'trandate':'20140702'}).asArray() is interpreted as db.find({'trandate':20140702}).asArray(). I have tried double quotes, single quotes, quotes with extra quotes, converting the value toString(), etc., but to no avail. If I try a different CFMongoDB syntax (e.g. db.find(query={'trandate'='20140702'},sort={'trandate'=1}).asArray(), that's when I receive error 500s and 502s from the server, and I have to restart the CF Service to continue. I also tried the syntax db.query().$eq('trandate','20140702').find().asArray() and no luck. Unfortunately, I'm unable to determine why the CF Server crashes, but I'm assuming it is unable to parse the query correctly. |
Thanks again...I just found a workaround right there in the examples: mongoUtil = mongo.getMongoUtil(); The code above works perfectly. Thanks for your help. |
Great. Glad you got it working. On Thursday, July 3, 2014, appdevjrcigars [email protected] wrote:
|
It appears the find method is no longer returning records that match the criteria specified using MongoDB 2.6.x (did not work with 2.6.1 or 2.6.3)). A find is returning 0 results, regardless of the criteria, unless I put a limit. Limit is functioning, but it ignores any search criteria specified. The asArray() method is extremely slow and mostly returns error 500. Is anyone else seeing these problems?
The text was updated successfully, but these errors were encountered: