Search in sources :

Example 1 with BsonJavaScriptWithScope

use of org.bson.BsonJavaScriptWithScope in project mongo-java-driver by mongodb.

the class BsonJavaScriptWithScopeCodec method decode.

@Override
public BsonJavaScriptWithScope decode(final BsonReader bsonReader, final DecoderContext decoderContext) {
    String code = bsonReader.readJavaScriptWithScope();
    BsonDocument scope = documentCodec.decode(bsonReader, decoderContext);
    return new BsonJavaScriptWithScope(code, scope);
}
Also used : BsonDocument(org.bson.BsonDocument) BsonJavaScriptWithScope(org.bson.BsonJavaScriptWithScope)

Aggregations

BsonDocument (org.bson.BsonDocument)1 BsonJavaScriptWithScope (org.bson.BsonJavaScriptWithScope)1