* 숫자 증가
Update u = new Update();
u.inc("element", 1);
mongoTemplate.updateFirst(query(where("id").is(id)), u, domain.class);
* update in array(list)
Update u = new Update();
u.inc("array.$.value", 1);
mongoTemplate.updateFirst(query(where("id").is(id).and("array.key").is(key)), u, domain.class);
'Framework & Platform > Spring' 카테고리의 다른 글
spring - Servlet 3 Async Config (0) | 2014.05.01 |
---|---|
spring - spring mvc test (0) | 2014.04.17 |
spring - STOMP interceptor (0) | 2014.03.31 |
spring - springx2013-websocket (0) | 2014.03.29 |
spring - WebSocket STOMP (0) | 2014.03.28 |