You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The line var out = {"#lcase(outputType)#" = outputTarget}; will result in The key [OUTPUTTARGET] does not exist
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.
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.
The text was updated successfully, but these errors were encountered:
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" );
var out = {"#lcase(outputType)#" = outputTarget};
will result inThe key [OUTPUTTARGET] does not exist
outputTarget
then leads to aKey [result] doesn't exist in Map (com.mongodb.CommandResult)
in thevar mrCollection = mongo.getDBCollection( commandResult["result"] );
line further down.commandResult
object shows that there's a results key instead, which contains the data I want, but since since the linevar 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.The text was updated successfully, but these errors were encountered: