title: Error in MapReduce command with MongoDB Java API
body: <p>I'm testing the MongoDB Java API and I wanted to do a mapReduce.
  I implemented it as follow :</p>
  
  <pre><code>String map = "function() { " +
      "emit(this.ts, this.1_bid);}";
  
  String reduce = "function(key, values) {" +
      "return Array.sum(values);}";
  
  MapReduceCommand cmd = new MapReduceCommand(collection, map, reduce, null, MapReduceCommand.OutputType.INLINE, null);
  MapReduceOutput out = collection.mapReduce(cmd);
  
  for (DBObject o : out.results()) {
      System.out.println(o.toString());
  }
  </code></pre>
  
  <p>But when I execute it I have the following exception stack :</p>
  
  <pre><code>[tick_engine] 16:51:53.600 ERROR [MongoTickDataReader] Failed to read data from mongoDB
  com.mongodb.CommandFailureException: { "serverUsed" : "/127.0.0.1:27017" , "errmsg" : "exception: SyntaxError: Unexpected token ILLEGAL" , "code" : 16722 , "ok" : 0.0}
      at com.mongodb.CommandResult.getException(CommandResult.java:71) ~[mongo-2.11.1.jar:na]
      at com.mongodb.CommandResult.throwOnError(CommandResult.java:110) ~[mongo-2.11.1.jar:na]
      at com.mongodb.DBCollection.mapReduce(DBCollection.java:1265) ~[mongo-2.11.1.jar:na]
      at com.smarttrade.tickEngine.in.MongoTickDataReader.mapReduce(MongoTickDataReader.java:321) ~[classes/:na]
      at com.smarttrade.tickEngine.in.MongoTickDataReader.readData(MongoTickDataReader.java:157) ~[classes/:na]
      at com.smarttrade.tick.engine.TickEngine.onMarketDataRequest(TickEngine.java:203) [classes/:na]
      at com.smarttrade.tick.sttp.TickMarketDataRequestCommand.execute(TickMarketDataRequestCommand.java:62) [classes/:na]
      at com.smarttrade.st.commands.Command.process(Command.java:140) [src/:na]
      at com.smarttrade.st.server.STTPInvoker$1.process(STTPInvoker.java:385) [src/:na]
      at com.smarttrade.st.server.STTPInvoker$1.process(STTPInvoker.java:1) [src/:na]
      at com.smarttrade.util.concurrent.queue.MultiSessionsBlockingQueue$SimpleSession.run(MultiSessionsBlockingQueue.java:122) [src/:na]
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [na:1.7.0_51]
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [na:1.7.0_51]
      at java.lang.Thread.run(Thread.java:744) [na:1.7.0_51]
  </code></pre>