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

Inline mapReduce() currently not possible. #43

Open
michael-zock opened this issue Jan 21, 2014 · 0 comments
Open

Inline mapReduce() currently not possible. #43

michael-zock opened this issue Jan 21, 2014 · 0 comments

Comments

@michael-zock
Copy link

If you just want to do an inline mapReduce() the current version of the DBCollection.cfc will run into a whole cascade of problems.

Example: mongodb.getDBCollection(LOCAL.collectionName).mapReduce( map=LOCAL.map, reduce=LOCAL.reduce, query=LOCAL.query, outputType="inline" );

  1. The line var out = {"#lcase(outputType)#" = outputTarget}; will result in The key [OUTPUTTARGET] does not exist
  2. Fixing that by assigning an empty string as a default of the outputTarget then leads to a Key [result] doesn't exist in Map (com.mongodb.CommandResult) in the var mrCollection = mongo.getDBCollection( commandResult["result"] );line further down.
  3. A quick dump of the commandResultobject shows that there's a results key instead, which contains the data I want, but since since the line var mrCollection = mongo.getDBCollection( commandResult["results"] ); expects the name of a collection to read from there even though it's not really necessary, we're facing another problem.

In my case it's probably enough to just return the "results" key in case of inline uses, but it would be great if someone with more experience could take a look at this problem.

Thanks in advance!

BTW: Current workaround is to just use the command(createOrderedDBObject( foo )) approach.

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

1 participant