Working some more on mongo-stuff

This commit is contained in:
Olof Larsson 2013-05-01 14:48:24 +02:00
parent 81be88fca8
commit 4d6c73f1d6
2 changed files with 14 additions and 4 deletions

View File

@ -31,12 +31,22 @@ public class CmdMCoreMStoreCopydb extends MCoreCommand
{
// Args
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 Db toDb = MStore.getDb(toAlias);
if (toDb == null)
{
msg("<b>could not get the to-database.");
return;
}
// Prepare
final Db fromDb = MStore.getDb(fromAlias);
final Db toDb = MStore.getDb(toAlias);
final Driver fromDriver = fromDb.getDriver();
final Driver toDriver = toDb.getDriver();

View File

@ -70,7 +70,7 @@ public final class MongoGsonConverter
if (inElement.isJsonNull()) return null;
JsonPrimitive in = inElement.getAsJsonPrimitive();
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();
throw new IllegalArgumentException("Unsupported value type for: " + in);
}