Package jp.ameba.mongo.protocol

Examples of jp.ameba.mongo.protocol.Delete


  }
 
  @Test
  public void testInsert() throws Exception {
   
    client.delete(new Delete("test", "insert", new BasicBSONObject("_id", 1)));
   
    // insert new document
    client.insert(
        new Insert("test", "insert",
          new BasicBSONObject("_id", 1)
View Full Code Here


   * データ準備
   */
  private void prepareData() {
   
    Response response = client.query(new Query("test", "testQuery", 0, 100, new BasicBSONObject(), null));
    client.delete(new Delete("test", "testQuery", new BasicBSONObject()));
    response = client.query(new Query("test", "$cmd", 0, 1, new BasicBSONObject("count", "testQuery"), null));
   
    Assert.assertEquals(1, response.getNumberReturned());
    BSONObject result = response.getDocuments().get(0);
    Assert.assertEquals(0.0, result.get("n"));
View Full Code Here

  }
 
  @Test
  public void testUpdate() throws Exception {
   
    client.delete(new Delete("test", "update", new BasicBSONObject("_id", "updateId")));
    // Test null update
    client.update(new Update("test", "update",
        new BasicBSONObject("_id", "updateId"),
        new BasicBSONObject("name", "abcdefg")
    ));
View Full Code Here

  }
 
  @Test
  public void testUpsert() throws Exception {
   
    client.delete(new Delete("test", "update", new BasicBSONObject("_id", "updateId")));
   
    Update update = new Update("test", "update",
        new BasicBSONObject("_id", "updateId"),
        new BasicBSONObject()
          .append("_id", "updateId")
View Full Code Here

  }

  @Override
  public void remove(BSONObject selector, Consistency consistency) {
    client.getConnection().delete(
        new Delete(
            databaseName,
            collectionName,
            selector
        ).consistency(consistency)
    );
View Full Code Here

  }
 
  @Override
  public void remove() {
    if (currentObject != null) {
      Delete delete = new Delete(
          databaseName,
          collectionName,
          new BasicBSONObject("_id", currentObject.get("_id"))
      );
      conn.delete(delete);
View Full Code Here

TOP

Related Classes of jp.ameba.mongo.protocol.Delete

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.