flapdoodle-oss / de.flapdoodle.embed.mongo

...will provide a platform neutral way for running mongodb in unittests.
Apache License 2.0
907 stars 160 forks source link

Unable to query multiple documents while testing. #533

Closed SOCRATESZZ closed 1 month ago

SOCRATESZZ commented 3 months ago

Whenever I am trying to retrieve two documents. It is throwing connection time out error. The code works correctly when I try to retrieve 1 document. But when I try to query multiple documents. It throws connection time out error I am using Morphia.

function to return datastore
mongodb = Mongod.instance().start(Version.V7_0_12);
    ServerAddress serverAddress = mongodb.current().getServerAddress();
    MongoClient mongoClient = MongoClients.create("mongodb://" + serverAddress);
    datastore = Morphia.createDatastore(mongoClient, MorphiaConfig.load());

datastore.find(mongoModelType).filter(Filters.eq("id", user.getId()))

michaelmosmann commented 2 months ago

@SOCRATESZZ do you have any stack trace?

michaelmosmann commented 1 month ago

@SOCRATESZZ i close this issue.. reopen if needed..