Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import com.mongodb.*;
- import org.apache.jmeter.protocol.mongodb.config.MongoDBHolder
- import java.util.concurrent.ThreadLocalRandom;
- int randomNumber = ThreadLocalRandom.current().nextInt(1, 50000001);
- DB db = MongoDBHolder.getDBFromSource(„whatever“, „inka“);
- DBCollection collection = db.getCollection(„profiles“);
- BasicDBObject query = new BasicDBObject(„_id“, randomNumber);
- DBObject result = collection.findOne(query);
- SampleResult.setResponseData(result.toString().getBytes());
Add Comment
Please, Sign In to add comment