Skip to content
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

DBCollection findOne is not passing through projection parameter #47

Open
boughtonp opened this issue Jul 17, 2014 · 2 comments
Open

DBCollection findOne is not passing through projection parameter #47

boughtonp opened this issue Jul 17, 2014 · 2 comments

Comments

@boughtonp
Copy link

As per the mongoDB docs, findOne has two optional arguments, criteria and projection:
http://docs.mongodb.org/manual/reference/method/db.collection.findOne/

The findOne method in DBCollection.cfc only passes in criteria, so trying to exclude the id value with a projection of {_id:0} doesn't work.

Updating the CFC to simply include/pass through the extra argument doesn't appear to change anything.

@boughtonp
Copy link
Author

Oops, updating the CFC does work - I needed to pass in {'_id':0} to prevent CF uppercasing the key.

I'll send a suitable pull request later.

@JamoCA
Copy link

JamoCA commented Feb 19, 2016

After upgrading a project from ColdFusion 9 (JRun) to 10 (Tomcat), I discovered that JavaCast() was required to set $sum parameters to "int" otherwise the result was always returned as 0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants