Package jmockmongo

Examples of jmockmongo.DefaultQueryHandler


  public BSONObject handleCommand(String database, BSONObject command) {
    Unsupported.supportedAndRequiredFields(command, "count", "query");
    String collection = (String) command.get("count");
    BSONObject query = (BSONObject) command.get("query");
    int l = new DefaultQueryHandler(mongo).handleQuery(database,
        collection, query).length;
    return new BasicBSONObject("ok", 1).append("n", l);
  }
View Full Code Here


        "query", "update");
    String collection = (String) command.get("findandmodify");
    BSONObject query = (BSONObject) command.get("query");
    BSONObject update = (BSONObject) command.get("update");

    BSONObject[] data = new DefaultQueryHandler(mongo).handleQuery(
        database, collection, query);

    if (data.length == 0)
      return new BasicBSONObject("ok", 1).append("n", 0);
    if (data.length > 1)
View Full Code Here

TOP

Related Classes of jmockmongo.DefaultQueryHandler

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.