try MongoDBExecutor . This will definitely increase development productivity. Here is a simple CRUD example:
@Test public void test_crud_by_id() { Account account = createAccount(); account.setId(ObjectId.get().toString()); // create collExecutor.insert(account); // read Account dbAccount = collExecutor.get(Account.class, account.getId()); // update dbAccount.setFirstName("newFirstName"); collExecutor.update(dbAccount.getId(), N.asMap(FIRST_NAME, dbAccount.getFirstName())); // delete collExecutor.delete(dbAccount.getId()); // check assertFalse(collExecutor.exists(dbAccount.getId())); }
Declaration: I am a developer of AbacusUtil
user_3380739
source share