Working some more on mongo-stuff
This commit is contained in:
parent
81be88fca8
commit
4d6c73f1d6
@ -31,12 +31,22 @@ public class CmdMCoreMStoreCopydb extends MCoreCommand
|
|||||||
{
|
{
|
||||||
// Args
|
// Args
|
||||||
final String fromAlias = this.arg(0);
|
final String fromAlias = this.arg(0);
|
||||||
|
final Db fromDb = MStore.getDb(fromAlias);
|
||||||
|
if (fromDb == null)
|
||||||
|
{
|
||||||
|
msg("<b>could not get the from-database.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
final String toAlias = this.arg(1);
|
final String toAlias = this.arg(1);
|
||||||
|
final Db toDb = MStore.getDb(toAlias);
|
||||||
|
if (toDb == null)
|
||||||
|
{
|
||||||
|
msg("<b>could not get the to-database.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Prepare
|
// Prepare
|
||||||
final Db fromDb = MStore.getDb(fromAlias);
|
|
||||||
final Db toDb = MStore.getDb(toAlias);
|
|
||||||
|
|
||||||
final Driver fromDriver = fromDb.getDriver();
|
final Driver fromDriver = fromDb.getDriver();
|
||||||
final Driver toDriver = toDb.getDriver();
|
final Driver toDriver = toDb.getDriver();
|
||||||
|
|
||||||
|
@ -70,7 +70,7 @@ public final class MongoGsonConverter
|
|||||||
if (inElement.isJsonNull()) return null;
|
if (inElement.isJsonNull()) return null;
|
||||||
JsonPrimitive in = inElement.getAsJsonPrimitive();
|
JsonPrimitive in = inElement.getAsJsonPrimitive();
|
||||||
if (in.isBoolean()) return in.getAsBoolean();
|
if (in.isBoolean()) return in.getAsBoolean();
|
||||||
if (in.isNumber()) return in.getAsNumber();
|
if (in.isNumber()) return in.getAsNumber().doubleValue();
|
||||||
if (in.isString()) return in.getAsString();
|
if (in.isString()) return in.getAsString();
|
||||||
throw new IllegalArgumentException("Unsupported value type for: " + in);
|
throw new IllegalArgumentException("Unsupported value type for: " + in);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user