Package org.springframework.data.mongodb.core

Examples of org.springframework.data.mongodb.core.MongoTemplate.findAll()


    mongoOps.updateFirst(query(where("name").is("Joe")), update("age", 35),
        Person.class);
    p = mongoOps.findOne(query(where("name").is("Joe")), Person.class);
    log.info("Updated: " + p); // Delete mongoOps.remove(p);
    // Check that deletion worked
    List<Person> people = mongoOps.findAll(Person.class);
    log.info("Number of people = : " + people.size());
//    mongoOps.dropCollection(Person.class);
  }
}
View Full Code Here


          collection.insert(dbo);
          return null;
        }
      });
    }
    List records = mongoTemplate.findAll(BasicDBObject.class, "records");
    Assert.assertEquals("Did not load the data correctly", 200, records.size());
    mongo.close();

    stopTunnelServer();
    removeService(VCAP_MONGO_SERVICE);
View Full Code Here

   
    // Delete
    mongoOps.remove(p);
   
    // Check that deletion worked
    List<Person> people =  mongoOps.findAll(Person.class);
    log.info("Number of people = : " + people.size());

   
    //mongoOps.dropCollection(Person.class);
  }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.