[JAVA-125] issue reported where certain types of map functions can't be parsed by java driver Created: 29/Jun/10  Updated: 29/Oct/10  Resolved: 20/Jul/10

Status: Closed
Project: Java Driver
Component/s: None
Affects Version/s: None
Fix Version/s: 2.1

Type: Bug Priority: Major - P3
Reporter: Aaron Staple Assignee: Eliot Horowitz (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

Eval JS Function = mc={m:function () { emit(

{hid:this.hid}

, this.vt); }}
Exception in thread "main" java.lang.UnsupportedOperationException: can't handle CODE yet
at org.bson.BSONDecoder.decodeElement(BSONDecoder.java:165)
at org.bson.BSONDecoder.decodeElement(BSONDecoder.java:181)
at org.bson.BSONDecoder.decode(BSONDecoder.java:71)
at org.bson.BSONDecoder.decode(BSONDecoder.java:55)
at org.bson.BSONDecoder.decode(BSONDecoder.java:42)
at com.mongodb.Response.<init>(Response.java:70)
at com.mongodb.DBPort.go(DBPort.java:81)
at com.mongodb.DBPort.call(DBPort.java:57)
at com.mongodb.DBTCPConnector.call(DBTCPConnector.java:181)
at com.mongodb.DBApiLayer$MyCollection.__find(DBApiLayer.java:277)
at com.mongodb.DBCollection.findOne(DBCollection.java:366)
at com.mongodb.DBCollection.findOne(DBCollection.java:355)
at com.mongodb.DB.command(DB.java:135)
at com.mongodb.DB.doEval(DB.java:148)
at com.mongodb.DB.eval(DB.java:157)
...

Adding another statement before emit worked.

mc={m:function() {var test=""; emit(

{hid:this.hid}

, this.vt);}}



 Comments   
Comment by auto [ 20/Jul/10 ]

Author:

{'login': 'erh', 'name': 'Eliot Horowitz', 'email': 'eliot@10gen.com'}

Message: cleanup Code and CodeWScope JAVA-125
http://github.com/mongodb/mongo-java-driver/commit/5d72a01ee890d55368708ed4fbd78b607e49da5a

Generated at Thu Feb 08 08:51:33 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.