Package org.springframework.data.mongodb.core.query

Examples of org.springframework.data.mongodb.core.query.Update.pushAll()


    doc.string2 = Arrays.asList("one");

    template.save(doc);

    Update update = new Update().pushAll("string1", new Object[] { "data", "mongodb" });
    update.pushAll("string2", new String[] { "two", "three" });

    Query findQuery = new Query(Criteria.where("id").is(doc.id));
    template.updateFirst(findQuery, update, DocumentWithMultipleCollections.class);

    DocumentWithMultipleCollections result = template.findOne(findQuery, DocumentWithMultipleCollections.class);
View Full Code Here


    doc.string2 = Arrays.asList("one");

    template.save(doc);

    Update update = new Update().pushAll("string1", new Object[] { "data", "mongodb" });
    update.pushAll("string2", new String[] { "two", "three" });

    Query findQuery = new Query(Criteria.where("id").is(doc.id));
    template.updateFirst(findQuery, update, DocumentWithMultipleCollections.class);

    DocumentWithMultipleCollections result = template.findOne(findQuery, DocumentWithMultipleCollections.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.