mirror of
https://github.com/plexusorg/Plex.git
synced 2024-12-22 17:17:37 +00:00
Fix (some) MongoDB errors
Co-Authored-By: taahanis <6778012+taahanis@users.noreply.github.com>
This commit is contained in:
parent
0bbe2d06f6
commit
9b0f928386
@ -30,18 +30,17 @@ public class MongoConnection implements PlexBase
|
|||||||
{
|
{
|
||||||
if (database != null && !database.isEmpty())
|
if (database != null && !database.isEmpty())
|
||||||
{
|
{
|
||||||
connectionString = "mongodb://" + username + ":" + password + "@" + host + ":" + port + "/?authSource=" + database;
|
connectionString = "mongodb://" + username + ":" + password + "@" + host + ":" + port + "/?authSource=" + database + "&uuidRepresentation=STANDARD";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
connectionString = "mongodb://" + username + ":" + password + "@" + host + ":" + port + "/";
|
connectionString = "mongodb://" + username + ":" + password + "@" + host + ":" + port + "/?uuidRepresentation=STANDARD";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
connectionString = "mongodb://" + host + ":" + port + "/";
|
connectionString = "mongodb://" + host + ":" + port + "/?uuidRepresentation=STANDARD";
|
||||||
}
|
}
|
||||||
connectionString += "?uuidRepresentation=STANDARD";
|
|
||||||
PlexLog.debug("Using mongo connection string: " + connectionString);
|
PlexLog.debug("Using mongo connection string: " + connectionString);
|
||||||
MongoClient client = MongoClients.create(connectionString);
|
MongoClient client = MongoClients.create(connectionString);
|
||||||
Datastore datastore = Morphia.createDatastore(client, database == null ? "admin" : database, MapperOptions.DEFAULT);
|
Datastore datastore = Morphia.createDatastore(client, database == null ? "admin" : database, MapperOptions.DEFAULT);
|
||||||
|
Loading…
Reference in New Issue
Block a user