K
K
kr1337ol2020-11-28 18:51:43
Java
kr1337ol, 2020-11-28 18:51:43

How to update entity in mongoDB by entity projection?

There is a class

class A {
    private String id;
    private String field1;
    private Map<String, Set<String>> field2;
}

He has a projection

class ProjectionA {
    private String id;
    private Map<String, Set<String>> field2;
}

I get all objects by class A projection , change the information in the field2 field and want to make changes to the database, how can I save all objects in the database by their projection?
That is, how can you change an object in the database without pulling out the entire object, but only a part of it?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question