Guest User

Untitled

a guest
Nov 22nd, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. import com.mongodb.*;
  2. import org.apache.jmeter.protocol.mongodb.config.MongoDBHolder
  3. import java.util.concurrent.ThreadLocalRandom;
  4.  
  5. int randomNumber = ThreadLocalRandom.current().nextInt(1, 50000001);
  6.  
  7. DB db = MongoDBHolder.getDBFromSource(„whatever“, „inka“);
  8. DBCollection collection = db.getCollection(„profiles“);
  9.  
  10. BasicDBObject query = new BasicDBObject(„_id“, randomNumber);
  11. DBObject result = collection.findOne(query);
  12.  
  13. SampleResult.setResponseData(result.toString().getBytes());
Add Comment
Please, Sign In to add comment