Update
-
Multiple DocumentsBackEnd/Elasticsearch API 2025. 3. 10. 01:00
_update_by_queryTo update documents in Elasticsearch based on a query, you can use the _update_by_query API.# 모든 Documents를 업데이트 합니다.POST /store/_update_by_query{ "script": { "source": "ctx._source.stock-=1" }}# product가 peach인 Documents만 업데이트 합니다.POST /store/_update_by_query{ "script": { "source": "ctx._source.stock-=1" }, "query": { "term": { "product": "peach" } }} _del..
-
DocumentBackEnd/Elasticsearch API 2025. 3. 9. 10:00
Create# create an indexPUT /my_index{ "settings": { "index": { "number_of_shards": 1, // You can specify the number of shards here "number_of_replicas": 1 // Set to 0 for no replicas } }}# crate a documentPOST /my_index/_doc/100{ "title": "Elasticsearch Advanced", "author": "Anthony K", "publish_date": "2024-05-20", "tags": ["search", "analytics"]} RetrieveGET /my_index/..
-
11. Querydsl Update/Delete BulkBackEnd/Querydsl 2021. 7. 29. 20:50
[전체소스코드] (주의) JPQL 배치와 마찬가지로, 영속성 컨텍스트에 있는 엔티티를 무시하고 실행되기 때문에 배치 쿼리를 실행하고 나면 영속성 컨텍스트를 초기화 하는 것이 안전하다. 1. Update long count = queryFactory .update(member) .set(member.username, "비회원") /** 기존 숫자에 더하기 .set(member.age, member.age.add(1)) 기존 숫자에 곱하기 .set(member.age, member.age.multiply(2)) */ .where(member.age.lt(28)) .execute(); 2. Delete long count = queryFactory .delete(member) .where(member.age...