Package com.mongodb

Examples of com.mongodb.DefaultDBEncoder.encode()


       
        DefaultDBEncoder encoder = new DefaultDBEncoder();
        BSONObject bsonObject = new BasicDBObject();
        bsonObject.put("_id", "testInsertBsonString");
       
        Object result = template.requestBody("direct:insertJsonString", new ByteArrayInputStream(encoder.encode(bsonObject)));
        assertTrue(result instanceof WriteResult);
        DBObject b = testCollection.findOne("testInsertBsonString");
        assertNotNull("No record with 'testInsertBsonString' _id", b);
    }
   
View Full Code Here


       
        DefaultDBEncoder encoder = new DefaultDBEncoder();
        BSONObject bsonObject = new BasicDBObject();
        bsonObject.put("_id", "testInsertBsonString");
       
        Object result = template.requestBody("direct:insertJsonString", new ByteArrayInputStream(encoder.encode(bsonObject)));
        assertTrue(result instanceof WriteResult);
        DBObject b = testCollection.findOne("testInsertBsonString");
        assertNotNull("No record with 'testInsertBsonString' _id", b);
    }
   
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.