return commandCreateIndexes(channel, command, query);
} else if (command.equalsIgnoreCase("count")) {
return commandCount(command, query);
} else if (command.equalsIgnoreCase("distinct")) {
String collectionName = query.get(command).toString();
MongoCollection collection = resolveCollection(collectionName, true);
return collection.handleDistinct(query);
} else if (command.equalsIgnoreCase("drop")) {
return commandDrop(query);
} else if (command.equalsIgnoreCase("dropDatabase")) {
return commandDropDatabase();
} else if (command.equalsIgnoreCase("dbstats")) {
return commandDatabaseStats();
} else if (command.equalsIgnoreCase("collstats")) {
String collectionName = query.get("collstats").toString();
MongoCollection collection = resolveCollection(collectionName, true);
return collection.getStats();
} else if (command.equalsIgnoreCase("validate")) {
String collectionName = query.get("validate").toString();
MongoCollection collection = resolveCollection(collectionName, true);
return collection.validate();
} else if (command.equalsIgnoreCase("findAndModify")) {
String collectionName = query.get(command).toString();
MongoCollection collection = resolveOrCreateCollection(collectionName);
return collection.findAndModify(query);
} else {
log.error("unknown query: {}", query);
}
throw new NoSuchCommandException(command);
}