Skip to content

MongoshScriptEngine execute result instanceof xxxResult always return null  #18

@dajinglingpake

Description

@dajinglingpake

MongoshScriptEngine execute result instanceof xxxResult return null
Why is it null? It actually has results in mongosh.

I changed it so that it can always return the result.

  if (result instanceof VoidResult || result instanceof MongoShellUpdateResult || result instanceof BSONTimestampResult){
    return Util.ok(result._asPrintable());
  }else if (result instanceof DateResult || result instanceof DBRefResult || result instanceof InsertOneResult
          || result instanceof UUIDResult){
    return Util.ok(result.getValue().toString());
  }else {
    return Util.ok(result.getValue());
  }

Metadata

Metadata

Assignees

Labels

questionFurther information is requested

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions